mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 15:39:02 -04:00
simplify getting the *caddy.Replacer
line
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
This commit is contained in:
parent
f94affbc39
commit
998d165b45
@ -158,7 +158,7 @@ func (ash *Handler) Provision(ctx caddy.Context) error {
|
|||||||
return fmt.Errorf("certificate lifetime (%s) should be less than intermediate certificate lifetime (%s)", time.Duration(ash.Lifetime), time.Duration(ca.IntermediateLifetime))
|
return fmt.Errorf("certificate lifetime (%s) should be less than intermediate certificate lifetime (%s)", time.Duration(ash.Lifetime), time.Duration(ca.IntermediateLifetime))
|
||||||
}
|
}
|
||||||
|
|
||||||
repl, ok := ctx.Context.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
|
repl, ok := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
|
||||||
if !ok {
|
if !ok {
|
||||||
repl = caddy.NewReplacer()
|
repl = caddy.NewReplacer()
|
||||||
ctx.Context = context.WithValue(ctx.Context, caddy.ReplacerCtxKey, repl)
|
ctx.Context = context.WithValue(ctx.Context, caddy.ReplacerCtxKey, repl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user