summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 9cf52dc..3eaf48f 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -112,6 +112,10 @@ func (m MatchHost) Match(r *http.Request) bool {
if err != nil {
// OK; probably didn't have a port
reqHost = r.Host
+
+ // make sure we strip the brackets from IPv6 addresses
+ reqHost = strings.TrimPrefix(reqHost, "[")
+ reqHost = strings.TrimSuffix(reqHost, "]")
}
outer: