mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-30 10:55:16 -04:00
Use Base64Url form for paths. (#556)
This commit is contained in:
+2
-2
@@ -24,9 +24,9 @@ func GetPath(c echo.Context) (string, string, error) {
|
||||
if key == "" {
|
||||
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Missing resouce path.")
|
||||
}
|
||||
pathb, err := base64.StdEncoding.DecodeString(key)
|
||||
pathb, err := base64.RawURLEncoding.DecodeString(key)
|
||||
if err != nil {
|
||||
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Invalid path. Should be base64 encoded.")
|
||||
return "", "", echo.NewHTTPError(http.StatusBadRequest, "Invalid path. Should be base64url (without padding) encoded.")
|
||||
}
|
||||
path := filepath.Clean(string(pathb))
|
||||
if !filepath.IsAbs(path) {
|
||||
|
||||
Reference in New Issue
Block a user