summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2021-06-16 14:29:42 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2021-06-16 14:29:42 -0600
commit238914d70b0f6c277494f0296a15eb9eb84ecc76 (patch)
tree1b322548c2f817008d662374d4b3633a903d58fc /modules/caddyhttp/reverseproxy/fastcgi
parente8ae80adca5db7102e646954fcc53827732ceb83 (diff)
Some misc. cleanup
The fastcgi changes came from v1 which don't make sense in v2. Fix comment about default value in reverse proxy keep alive.
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
index 0976437..d7a0e36 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
@@ -236,13 +236,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
// original URI in as the value of REQUEST_URI (the user can overwrite this
// if desired). Most PHP apps seem to want the original URI. Besides, this is
// how nginx defaults: http://stackoverflow.com/a/12485156/1048862
- origReq, ok := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
- if !ok {
- // some requests, like active health checks, don't add this to
- // the request context, so we can just use the current URL
- origReq = *r
- }
- reqURL := origReq.URL
+ origReq := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
requestScheme := "http"
if r.TLS != nil {
@@ -285,7 +279,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
"DOCUMENT_ROOT": root,
"DOCUMENT_URI": docURI,
"HTTP_HOST": r.Host, // added here, since not always part of headers
- "REQUEST_URI": reqURL.RequestURI(),
+ "REQUEST_URI": origReq.URL.RequestURI(),
"SCRIPT_FILENAME": scriptFilename,
"SCRIPT_NAME": scriptName,
}