summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-04-03 10:25:25 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-04-03 10:25:25 -0600
commit1e8af2732946e39fe2821c8a63c2c9746d1672fc (patch)
tree78de34b69adad5d6bd1c708e5367dc9fe032a43b /modules/caddyhttp/reverseproxy/fastcgi
parentb6482e53c1d0ff11756e7c51ab3dde2c0a7134f4 (diff)
fastcgi: Account for lack of split path configuration (fix #3221)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
index 915b8df..6ad5047 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
@@ -181,14 +181,14 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
fpath := r.URL.Path
- // Split path in preparation for env variables.
- // Previous canSplit checks ensure this can never be -1.
- // TODO: I haven't brought over canSplit from v1; make sure this doesn't break
- splitPos := t.splitPos(fpath)
-
- // Request has the extension; path was split successfully
- docURI := fpath[:splitPos]
- pathInfo := fpath[splitPos:]
+ // split "actual path" from "path info" if configured
+ var docURI, pathInfo string
+ if splitPos := t.splitPos(fpath); splitPos > -1 {
+ docURI = fpath[:splitPos]
+ pathInfo = fpath[splitPos:]
+ } else {
+ docURI = fpath
+ }
scriptName := fpath
// Strip PATH_INFO from SCRIPT_NAME