From a55553b7856e97d26821199aecd71ddf7360d04d Mon Sep 17 00:00:00 2001 From: Nixon Date: Tue, 13 Aug 2024 14:25:54 -0700 Subject: [PATCH] meh --- keydb_extension.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/keydb_extension.go b/keydb_extension.go index af473b8..4b31605 100644 --- a/keydb_extension.go +++ b/keydb_extension.go @@ -76,9 +76,15 @@ func (h *KeyDBHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { return d.ArgErr() } case "db": - if !d.Args(strconv.Atoi(&h.DB)) { + var dbStr string + if !d.Args(&dbStr) { return d.ArgErr() } + db, err := strconv.Atoi(dbStr) + if err != nil { + return d.Errf("invalid db number: %v", err) + } + h.DB = db } } }