mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue