Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 10:30 UTC
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
lemmi committed
Sep 27, 2022 at 21:03 UTC
d0556929a4a574ea67be4c1ca2a2741b0f7a52c2
1 file changed
+1
-1
modules/caddyhttp/reverseproxy/command.go
+1
-1
@@ -117,7 +117,7 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) {
117
if err != nil {
118
return caddy.ExitCodeFailedStartup, fmt.Errorf("invalid upstream address %s: %v", toLoc, err)
119
}
120
- if scheme != "" && toScheme != "" {
120
+ if scheme != "" && toScheme == "" {
121
toScheme = scheme
122
}
123
toAddresses[i] = addr