Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
reverseproxy: caddyfile: Don't add port if upstream has placeholder (#3819)
* check if the host is a placeholder * Update modules/caddyhttp/reverseproxy/caddyfile.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Jason McCallister committed
Oct 29, 2020 at 15:51 UTC
c9fdff9976da38c650a51cd3fb4f2667853ff627
1 file changed
+3
-1
modules/caddyhttp/reverseproxy/caddyfile.go
+3
-1
@@ -155,7 +155,9 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
155
if err != nil {
156
host = upstreamAddr
157
}
158
- if port == "" {
158
+ // we can assume a port if only a hostname is specified, but use of a
159
+ // placeholder without a port likely means a port will be filled in
160
+ if port == "" && !strings.Contains(host, "{") {
161
port = "80"
162
}
163
}