mirror of https://github.com/caddyserver/caddy.git
reverseproxy: fix upstream scheme handling in command (#5088)
e338648fed
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
This commit is contained in:
parent
b5727b9c44
commit
d0556929a4
|
@ -117,7 +117,7 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return caddy.ExitCodeFailedStartup, fmt.Errorf("invalid upstream address %s: %v", toLoc, err)
|
return caddy.ExitCodeFailedStartup, fmt.Errorf("invalid upstream address %s: %v", toLoc, err)
|
||||||
}
|
}
|
||||||
if scheme != "" && toScheme != "" {
|
if scheme != "" && toScheme == "" {
|
||||||
toScheme = scheme
|
toScheme = scheme
|
||||||
}
|
}
|
||||||
toAddresses[i] = addr
|
toAddresses[i] = addr
|
||||||
|
|
Loading…
Reference in New Issue