summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyhttp.go
diff options
context:
space:
mode:
authorPascal <pascalgn@users.noreply.github.com>2019-10-14 19:29:36 +0200
committerMatt Holt <mholt@users.noreply.github.com>2019-10-14 11:29:36 -0600
commitbc738991b6234bf334855e1396919e79ef9791b8 (patch)
tree62777f65ca331cf5125708f7200d381585e74ee3 /modules/caddyhttp/caddyhttp.go
parentfcd8869f51b78f260e3c3aed53d7d87c2051ffe9 (diff)
caddyhttp: Support placeholders in MatchHost (#2810)
* Replace global placeholders in host matcher * caddyhttp: Fix panic on MatchHost tests
Diffstat (limited to 'modules/caddyhttp/caddyhttp.go')
-rw-r--r--modules/caddyhttp/caddyhttp.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 191f803..5631b30 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -273,6 +273,8 @@ func (app *App) automaticHTTPS() error {
// addresses to the routes that do HTTP->HTTPS redirects
lnAddrRedirRoutes := make(map[string]Route)
+ repl := caddy.NewReplacer()
+
for srvName, srv := range app.Servers {
srv.tlsApp = tlsApp
@@ -294,6 +296,7 @@ func (app *App) automaticHTTPS() error {
for _, m := range matcherSet {
if hm, ok := m.(*MatchHost); ok {
for _, d := range *hm {
+ d = repl.ReplaceAll(d, "")
if certmagic.HostQualifies(d) &&
!srv.AutoHTTPS.Skipped(d, srv.AutoHTTPS.Skip) {
domainSet[d] = struct{}{}