Skip to content

Commit

Permalink
reverseproxy: fix upstream scheme handling in command (#5088)
Browse files Browse the repository at this point in the history
e338648 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
  • Loading branch information
lemmi committed Sep 27, 2022
1 parent b5727b9 commit d055692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/caddyhttp/reverseproxy/command.go
Expand Up @@ -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
Expand Down

0 comments on commit d055692

Please sign in to comment.