summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-03-23 18:29:16 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-03-23 18:29:16 -0600
commit235357abc80df710fe4c4ec21cf76d84cc664e17 (patch)
tree727a247f95f13973a74e64ef2c03f0668b952a88 /modules/caddyhttp/reverseproxy/fastcgi
parent4b4e16edafd62fe0d9510987984ed26c981e84da (diff)
fastcgi: Fix PATH_INFO (issue #3178)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
index 9d2dc39..99bf5ec 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
@@ -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