|
|
@ -3,9 +3,9 @@ package server
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"html"
|
|
|
|
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"net/url"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
@ -249,8 +249,10 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("ID is not a number: %s", c.Param("resourceId"))).SetInternal(err)
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("ID is not a number: %s", c.Param("resourceId"))).SetInternal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
filename, err := url.QueryUnescape(c.Param("filename"))
|
|
|
|
filename := html.UnescapeString(c.Param("filename"))
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("filename is invalid: %s", c.Param("filename"))).SetInternal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
resourceFind := &api.ResourceFind{
|
|
|
|
resourceFind := &api.ResourceFind{
|
|
|
|
ID: &resourceID,
|
|
|
|
ID: &resourceID,
|
|
|
|
Filename: &filename,
|
|
|
|
Filename: &filename,
|
|
|
|