mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-03 23:09:57 -05: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)
|
splitPos := t.splitPos(fpath)
|
||||||
|
|
||||||
// Request has the extension; path was split successfully
|
// Request has the extension; path was split successfully
|
||||||
docURI := fpath[:splitPos+len(t.SplitPath)]
|
docURI := fpath[:splitPos]
|
||||||
pathInfo := fpath[splitPos+len(t.SplitPath):]
|
pathInfo := fpath[splitPos:]
|
||||||
scriptName := fpath
|
scriptName := fpath
|
||||||
|
|
||||||
// Strip PATH_INFO from SCRIPT_NAME
|
// Strip PATH_INFO from SCRIPT_NAME
|
||||||
|
@ -292,7 +292,7 @@ func (t Transport) splitPos(path string) int {
|
||||||
lowerPath := strings.ToLower(path)
|
lowerPath := strings.ToLower(path)
|
||||||
for _, split := range t.SplitPath {
|
for _, split := range t.SplitPath {
|
||||||
if idx := strings.Index(lowerPath, strings.ToLower(split)); idx > -1 {
|
if idx := strings.Index(lowerPath, strings.ToLower(split)); idx > -1 {
|
||||||
return idx
|
return idx + len(split)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
|
|
Loading…
Add table
Reference in a new issue