Merge pull request #247 from DenBeke/master

fastcgi: Stripping PATH_INFO from SCRIPT_NAME
This commit is contained in:
Matt Holt 2015-09-28 14:33:27 -06:00
commit 79a7f8a460
2 changed files with 5 additions and 2 deletions

3
middleware/fastcgi/fastcgi.go Normal file → Executable file
View file

@ -166,6 +166,9 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
scriptFilename = absPath
}
// Strip PATH_INFO from SCRIPT_NAME
scriptName = strings.TrimSuffix(scriptName, pathInfo)
// Get the request URI. The request URI might be as it came in over the wire,
// or it might have been rewritten internally by the rewrite middleware (see issue #256).
// If it was rewritten, there will be a header indicating the original URL,