mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 09:06:41 +00:00
caddytls: Check type assertion
Fix https://github.com/mholt/caddy-l4/issues/378
This commit is contained in:
parent
3bb22672f9
commit
e0f8d9b204
1 changed files with 2 additions and 2 deletions
|
|
@ -502,8 +502,8 @@ func (t *TLSConfig) unmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
|||
// If there is no custom TLS configuration, a nil config may be returned.
|
||||
// copied from with minor modifications: modules/caddyhttp/reverseproxy/httptransport.go
|
||||
func (t *TLSConfig) makeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
|
||||
repl, _ := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
|
||||
if repl == nil {
|
||||
repl, ok := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
|
||||
if !ok || repl == nil {
|
||||
repl = caddy.NewReplacer()
|
||||
}
|
||||
cfg := new(tls.Config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue