Browse Source

fastcgi: Ensure root is always absolute (issue #3178) (#3182)

master
Matt Holt 5 years ago
committed by GitHub
parent
commit
2eede58b3a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go

7
modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go

@ -164,7 +164,12 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
ip = strings.Replace(ip, "[", "", 1)
ip = strings.Replace(ip, "]", "", 1)
root := repl.ReplaceAll(t.Root, ".")
// make sure file root is absolute
root, err := filepath.Abs(repl.ReplaceAll(t.Root, "."))
if err != nil {
return nil, err
}
fpath := r.URL.Path
// Split path in preparation for env variables.

Loading…
Cancel
Save