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 {
56
56
57
57
// Match matches hello based on SNI.
58
58
func (m MatchServerName ) Match (hello * tls.ClientHelloInfo ) bool {
59
- repl := caddy .NewReplacer ()
59
+ var repl * caddy.Replacer
60
60
// caddytls.TestServerNameMatcher calls this function without any context
61
61
if ctx := hello .Context (); ctx != nil {
62
62
// In some situations the existing context may have no replacer
@@ -65,6 +65,10 @@ func (m MatchServerName) Match(hello *tls.ClientHelloInfo) bool {
65
65
}
66
66
}
67
67
68
+ if repl == nil {
69
+ repl = caddy .NewReplacer ()
70
+ }
71
+
68
72
for _ , name := range m {
69
73
rs := repl .ReplaceAll (name , "" )
70
74
if certmagic .MatchWildcard (hello .ServerName , rs ) {
You can’t perform that action at this time.
0 commit comments