diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2022-07-13 08:52:30 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2022-07-13 08:52:30 -0600 |
commit | c2bbe42fc3553f6a5685cdb45453c0950fa614b2 (patch) | |
tree | e9e4b19d7d7ad60cd958a7a4baf7adfc278780a4 | |
parent | ad3a83fb9169899226ce12a61c16b5bf4d03c482 (diff) |
reverseproxy: Export SetScheme() again
Turns out the NTLM transport uses it. Oops.
-rw-r--r-- | modules/caddyhttp/reverseproxy/httptransport.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go index 94a0938..7b573f8 100644 --- a/modules/caddyhttp/reverseproxy/httptransport.go +++ b/modules/caddyhttp/reverseproxy/httptransport.go @@ -281,7 +281,7 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) { repl := req.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer) transport := h.replaceTLSServername(repl) - transport.setScheme(req) + transport.SetScheme(req) // if H2C ("HTTP/2 over cleartext") is enabled and the upstream request is // HTTP without TLS, use the alternate H2C-capable transport instead @@ -292,10 +292,13 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) { return transport.Transport.RoundTrip(req) } -// setScheme ensures that the outbound request req +// SetScheme ensures that the outbound request req // has the scheme set in its URL; the underlying // http.Transport requires a scheme to be set. -func (h *HTTPTransport) setScheme(req *http.Request) { +// +// This method may be used by other transport modules +// that wrap/use this one. +func (h *HTTPTransport) SetScheme(req *http.Request) { if req.URL.Scheme != "" { return } |