Unverified Commit 1dee8ae4 authored by Zeng1998's avatar Zeng1998 Committed by GitHub

fix: url resource filename decode (#738)

* fix: url resource filename decode

* update

* update
Co-authored-by: 's avatarboojack <stevenlgtm@gmail.com>
Co-authored-by: 's avatarboojack <stevenlgtm@gmail.com>
parent 3fd4ee83
......@@ -3,9 +3,9 @@ package server
import (
"encoding/json"
"fmt"
"html"
"io"
"net/http"
"net/url"
"strconv"
"time"
......@@ -249,8 +249,10 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("ID is not a number: %s", c.Param("resourceId"))).SetInternal(err)
}
filename := html.UnescapeString(c.Param("filename"))
filename, err := url.QueryUnescape(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{
ID: &resourceID,
Filename: &filename,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment