fastcgi: Fix PATH_INFO (issue #3178)

This commit is contained in:
Matthew Holt 2020-03-23 18:29:16 -06:00
parent 4b4e16edaf
commit 235357abc8
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -173,8 +173,8 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
splitPos := t.splitPos(fpath)
// Request has the extension; path was split successfully
docURI := fpath[:splitPos+len(t.SplitPath)]
pathInfo := fpath[splitPos+len(t.SplitPath):]
docURI := fpath[:splitPos]
pathInfo := fpath[splitPos:]
scriptName := fpath
// Strip PATH_INFO from SCRIPT_NAME
@ -292,7 +292,7 @@ func (t Transport) splitPos(path string) int {
lowerPath := strings.ToLower(path)
for _, split := range t.SplitPath {
if idx := strings.Index(lowerPath, strings.ToLower(split)); idx > -1 {
return idx
return idx + len(split)
}
}
return -1