mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-07 11:28:48 +03:00
middleware/fastcgi: Stripping PATH_INFO from SCRIPT_NAME
This commit is contained in:
parent
9dfb940d80
commit
aa5a595762
1 changed files with 6 additions and 0 deletions
6
middleware/fastcgi/fastcgi.go
Normal file → Executable file
6
middleware/fastcgi/fastcgi.go
Normal file → Executable file
|
@ -166,6 +166,12 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
|
|||
scriptFilename = absPath
|
||||
}
|
||||
|
||||
// Strip PATH_INFO from SCRIPT_NAME
|
||||
indexPathInfo := strings.LastIndex(scriptName, pathInfo)
|
||||
if indexPathInfo != -1 {
|
||||
scriptName = scriptName[:indexPathInfo]
|
||||
}
|
||||
|
||||
// Some variables are unused but cleared explicitly to prevent
|
||||
// the parent environment from interfering.
|
||||
env = map[string]string{
|
||||
|
|
Loading…
Reference in a new issue