mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-13 22:36:27 +03:00
fastcgi: Fix PATH_INFO (issue #3178)
This commit is contained in:
parent
4b4e16edaf
commit
235357abc8
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue