Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 17:15 UTC
caddytls: Check type assertion
Fix https://github.com/mholt/caddy-l4/issues/378
Matthew Holt committed
Feb 3, 2026 at 13:59 UTC
e0f8d9b2047af417d8faf354b675941f3dac9891
1 file changed
+2
-2
modules/caddytls/capools.go
+2
-2
@@ -502,8 +502,8 @@ func (t *TLSConfig) unmarshalCaddyfile(d *caddyfile.Dispenser) error {
502
// If there is no custom TLS configuration, a nil config may be returned.
503
// copied from with minor modifications: modules/caddyhttp/reverseproxy/httptransport.go
504
func (t *TLSConfig) makeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
505
- repl, _ := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
506
- if repl == nil {
505
+ repl, ok := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
506
+ if !ok || repl == nil {
507
repl = caddy.NewReplacer()
508
}
509
cfg := new(tls.Config)