summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMohammed Al Sahaf <msaa1990@gmail.com>2020-10-01 22:53:19 +0300
committerGitHub <noreply@github.com>2020-10-01 13:53:19 -0600
commitaa9c3eb7324461c0dd4f1dd28e767d0b8d0d7ec3 (patch)
treea5e332f08ffe46e25d1278d9cf6f6e6136dfc204 /modules/caddyhttp
parentfdfdc033392d6bcc8c98232d5db825fcf4b78a51 (diff)
reverseproxy: default to port 80 for upstreams in Caddyfile (#3772)
* reverseproxy: default to port 80 for port-less upstream dial addresses * reverseproxy: replace integration test with an adapter test Fixes #3761
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index 33f6e7b..fcaf82b 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -155,6 +155,9 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if err != nil {
host = upstreamAddr
}
+ if port == "" {
+ port = "80"
+ }
}
// the underlying JSON does not yet support different