File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ func (MatchServerName) CaddyModule() caddy.ModuleInfo {
5656
5757// Match matches hello based on SNI.
5858func (m MatchServerName ) Match (hello * tls.ClientHelloInfo ) bool {
59- repl := caddy .NewReplacer ()
59+ var repl * caddy.Replacer
6060 // caddytls.TestServerNameMatcher calls this function without any context
6161 if ctx := hello .Context (); ctx != nil {
6262 // In some situations the existing context may have no replacer
@@ -65,6 +65,10 @@ func (m MatchServerName) Match(hello *tls.ClientHelloInfo) bool {
6565 }
6666 }
6767
68+ if repl == nil {
69+ repl = caddy .NewReplacer ()
70+ }
71+
6872 for _ , name := range m {
6973 rs := repl .ReplaceAll (name , "" )
7074 if certmagic .MatchWildcard (hello .ServerName , rs ) {
You can’t perform that action at this time.
0 commit comments