mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 15:39:02 -04:00
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
This commit is contained in:
parent
b5727b9c44
commit
d0556929a4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user