From 998d165b45cda9f25e7daba282f5d97dccba7aaa Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Sun, 11 Feb 2024 16:09:51 +0300 Subject: [PATCH] simplify getting the `*caddy.Replacer` line Co-authored-by: Francis Lavoie --- modules/caddypki/acmeserver/acmeserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/caddypki/acmeserver/acmeserver.go b/modules/caddypki/acmeserver/acmeserver.go index 5e7a58c2..90b8a5aa 100644 --- a/modules/caddypki/acmeserver/acmeserver.go +++ b/modules/caddypki/acmeserver/acmeserver.go @@ -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)) } - repl, ok := ctx.Context.Value(caddy.ReplacerCtxKey).(*caddy.Replacer) + repl, ok := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer) if !ok { repl = caddy.NewReplacer() ctx.Context = context.WithValue(ctx.Context, caddy.ReplacerCtxKey, repl)