From bca610fbde82c4b45526dd526d7ddfa6e3bdac70 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 1 May 2020 09:34:32 -0600 Subject: httpcaddyfile: Minor fixes to parsing storage options --- caddyconfig/httpcaddyfile/options.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'caddyconfig') diff --git a/caddyconfig/httpcaddyfile/options.go b/caddyconfig/httpcaddyfile/options.go index 072d8f4..2ab73b2 100644 --- a/caddyconfig/httpcaddyfile/options.go +++ b/caddyconfig/httpcaddyfile/options.go @@ -136,14 +136,13 @@ func parseOptOrder(d *caddyfile.Dispenser) ([]string, error) { } func parseOptStorage(d *caddyfile.Dispenser) (caddy.StorageConverter, error) { - if !d.Next() { + if !d.Next() { // consume option name return nil, d.ArgErr() } - args := d.RemainingArgs() - if len(args) != 1 { + if !d.Next() { // get storage module name return nil, d.ArgErr() } - modName := args[0] + modName := d.Val() mod, err := caddy.GetModule("caddy.storage." + modName) if err != nil { return nil, d.Errf("getting storage module '%s': %v", modName, err) -- cgit v1.2.3