@marcel91200 / caddy Mirror · read-only / commits / 9798f696
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 14:45 UTC

caddyhttp: Avoid nil pointer dereference in proxyWrapper (#7521)

Fardjad Davari committed Feb 25, 2026 at 10:08 UTC 9798f6964d58eb5703d1498804962faca2dae4ea
1 file changed +3
modules/caddyhttp/reverseproxy/httptransport.go
+3
@@ -384,6 +384,9 @@ func (h *HTTPTransport) NewTransport(caddyCtx caddy.Context) (*http.Transport, e
384 }
385 // we need to keep track if a proxy is used for a request
386 proxyWrapper := func(req *http.Request) (*url.URL, error) {
387 + if proxy == nil {
388 + return nil, nil
389 + }
390 u, err := proxy(req)
391 if u == nil || err != nil {
392 return u, err