summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2023-04-26 22:46:41 -0400
committerGitHub <noreply@github.com>2023-04-27 02:46:41 +0000
commitf0e39817746903bb24948893348ae1cab67f1e46 (patch)
tree8cd863ea0dc3ede6b553eb298d214b29f8ef3bc6 /modules/caddyhttp/reverseproxy/fastcgi
parent1c9ea0113d007d57bb8f793ebe7a64a3dcad7bc7 (diff)
logging: Add traceID field to access logs when tracing is active (#5507)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
index ec194e7..5160067 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
@@ -254,9 +254,7 @@ func (t Transport) buildEnv(r *http.Request) (envVars, error) {
// if we didn't get a split result here.
// See https://github.com/caddyserver/caddy/issues/3718
if pathInfo == "" {
- if remainder, ok := repl.GetString("http.matchers.file.remainder"); ok {
- pathInfo = remainder
- }
+ pathInfo, _ = repl.GetString("http.matchers.file.remainder")
}
// SCRIPT_FILENAME is the absolute path of SCRIPT_NAME
@@ -286,10 +284,7 @@ func (t Transport) buildEnv(r *http.Request) (envVars, error) {
reqHost = r.Host
}
- authUser := ""
- if val, ok := repl.Get("http.auth.user.id"); ok {
- authUser = val.(string)
- }
+ authUser, _ := repl.GetString("http.auth.user.id")
// Some variables are unused but cleared explicitly to prevent
// the parent environment from interfering.