middleware/fastcgi: Stripping PATH_INFO from SCRIPT_NAME

This commit is contained in:
Mathias Beke 2015-09-16 20:25:40 +02:00
parent 9dfb940d80
commit aa5a595762

6
middleware/fastcgi/fastcgi.go Normal file → Executable file
View 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{