@marcel91200 / caddy Mirror · read-only / commits / 235357ab
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

fastcgi: Fix PATH_INFO (issue #3178)

Matthew Holt committed Mar 23, 2020 at 18:29 UTC 235357abc80df710fe4c4ec21cf76d84cc664e17
1 file changed +3 -3
modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+3 -3
@@ -173,8 +173,8 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
173 splitPos := t.splitPos(fpath)
174
175 // Request has the extension; path was split successfully
176 - docURI := fpath[:splitPos+len(t.SplitPath)]
177 - pathInfo := fpath[splitPos+len(t.SplitPath):]
176 + docURI := fpath[:splitPos]
177 + pathInfo := fpath[splitPos:]
178 scriptName := fpath
179
180 // Strip PATH_INFO from SCRIPT_NAME
@@ -292,7 +292,7 @@ func (t Transport) splitPos(path string) int {
292 lowerPath := strings.ToLower(path)
293 for _, split := range t.SplitPath {
294 if idx := strings.Index(lowerPath, strings.ToLower(split)); idx > -1 {
295 - return idx
295 + return idx + len(split)
296 }
297 }
298 return -1