aboutsummaryrefslogtreecommitdiff
path: root/plugin/auto/setup.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/auto/setup.go')
-rw-r--r--plugin/auto/setup.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/auto/setup.go b/plugin/auto/setup.go
index 2e2d0a37d..d6c4f8290 100644
--- a/plugin/auto/setup.go
+++ b/plugin/auto/setup.go
@@ -120,7 +120,7 @@ func autoParse(c *caddy.Controller) (Auto, error) {
}
}
- // regexp
+ // regexp template
if c.NextArg() {
a.loader.re, err = regexp.Compile(c.Val())
if err != nil {
@@ -129,10 +129,10 @@ func autoParse(c *caddy.Controller) (Auto, error) {
if a.loader.re.NumSubexp() == 0 {
return a, c.Errf("Need at least one sub expression")
}
- }
- // template
- if c.NextArg() {
+ if !c.NextArg() {
+ return a, c.ArgErr()
+ }
a.loader.template = rewriteToExpand(c.Val())
}