fastcgi: Trim dot and space suffix for Windows sake (#2917)

This commit is contained in:
MisterDuval 2019-12-14 19:21:27 +01:00 committed by Matt Holt
parent f0eae39cb2
commit 008415f206

View File

@ -85,6 +85,8 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
// but we also want to be flexible for the script we proxy to.
fpath := r.URL.Path
// We trim those characters because they are served as plain text if appended after .php on Windows
fpath = strings.TrimRight(fpath, " .")
if idx, ok := httpserver.IndexFile(h.FileSys, fpath, rule.IndexFiles); ok {
fpath = idx