Move FCGI req.URL.Path fix-up to the FCGI listener (#15292)

Simplify the web.go FCGI path by moving the req.URL.Path fix-up to listener

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
zeripath 2021-04-09 14:17:57 +01:00 committed by GitHub
parent 99f835b9ca
commit 9d2c251214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View file

@ -168,15 +168,6 @@ func WebRoutes() *web.Route {
r.Use(h)
}
if (setting.Protocol == setting.FCGI || setting.Protocol == setting.FCGIUnix) && setting.AppSubURL != "" {
r.Use(func(next http.Handler) http.Handler {
return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
req.URL.Path = strings.TrimPrefix(req.URL.Path, setting.AppSubURL)
next.ServeHTTP(resp, req)
})
})
}
mailer.InitMailRender(templates.Mailer())
if setting.Service.EnableCaptcha {