1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-01 23:28:36 +00:00

Use Request.URL.RequestURI() for fcgi (#14312) (#14347)

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Kyungmin Bae
2021-01-15 21:26:45 +09:00
committed by GitHub
parent 49d113945f
commit e846b712fc
2 changed files with 5 additions and 5 deletions

View File

@@ -121,11 +121,11 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
return
}
if !strings.HasPrefix(req.RequestURI, "/"+prefix) {
if !strings.HasPrefix(req.URL.RequestURI(), "/"+prefix) {
return
}
rPath := strings.TrimPrefix(req.RequestURI, "/"+prefix)
rPath := strings.TrimPrefix(req.URL.RequestURI(), "/"+prefix)
u, err := objStore.URL(rPath, path.Base(rPath))
if err != nil {
if os.IsNotExist(err) || errors.Is(err, os.ErrNotExist) {
@@ -152,11 +152,11 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
return
}
if !strings.HasPrefix(req.RequestURI, "/"+prefix) {
if !strings.HasPrefix(req.URL.RequestURI(), "/"+prefix) {
return
}
rPath := strings.TrimPrefix(req.RequestURI, "/"+prefix)
rPath := strings.TrimPrefix(req.URL.RequestURI(), "/"+prefix)
rPath = strings.TrimPrefix(rPath, "/")
//If we have matched and access to release or issue
fr, err := objStore.Open(rPath)