diff options
author | lemmi <[email protected]> | 2022-09-27 21:03:30 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-27 13:03:30 -0600 |
commit | d0556929a4a574ea67be4c1ca2a2741b0f7a52c2 (patch) | |
tree | 9bf5446bf2dc9c8ed57d22aeb1e4e2517d7ae392 | |
parent | b5727b9c443b45a83c463caa85a24783e901f144 (diff) | |
download | caddy-d0556929a4a574ea67be4c1ca2a2741b0f7a52c2.tar.gz caddy-d0556929a4a574ea67be4c1ca2a2741b0f7a52c2.zip |
reverseproxy: fix upstream scheme handling in command (#5088)
e338648fed3263200dfd6abc9f8100c6f1c0eb67 introduced multiple upstream
addresses. A comment notes that mixing schemes isn't supported and
therefore the first valid scheme is supposed to be used.
Fixes setting the first scheme.
fixes #5087
-rw-r--r-- | modules/caddyhttp/reverseproxy/command.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/caddyhttp/reverseproxy/command.go b/modules/caddyhttp/reverseproxy/command.go index 481f6e00d..1b6308615 100644 --- a/modules/caddyhttp/reverseproxy/command.go +++ b/modules/caddyhttp/reverseproxy/command.go @@ -117,7 +117,7 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) { if err != nil { return caddy.ExitCodeFailedStartup, fmt.Errorf("invalid upstream address %s: %v", toLoc, err) } - if scheme != "" && toScheme != "" { + if scheme != "" && toScheme == "" { toScheme = scheme } toAddresses[i] = addr |