summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/forwardauth
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/reverseproxy/forwardauth')
-rw-r--r--modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go b/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go
index cecc000..8350096 100644
--- a/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go
@@ -129,8 +129,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error)
return nil, dispenser.ArgErr()
}
rpHandler.Rewrite.URI = dispenser.Val()
- dispenser.Delete()
- dispenser.Delete()
+ dispenser.DeleteN(2)
case "copy_headers":
args := dispenser.RemainingArgs()
@@ -140,13 +139,11 @@ func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error)
args = append(args, dispenser.Val())
}
- dispenser.Delete() // directive name
+ // directive name + args
+ dispenser.DeleteN(len(args) + 1)
if hadBlock {
- dispenser.Delete() // opening brace
- dispenser.Delete() // closing brace
- }
- for range args {
- dispenser.Delete()
+ // opening & closing brace
+ dispenser.DeleteN(2)
}
for _, headerField := range args {
@@ -219,6 +216,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error)
// the rest of the config is specified by the user
// using the reverse_proxy directive syntax
+ dispenser.Next() // consume the directive name
err = rpHandler.UnmarshalCaddyfile(dispenser)
if err != nil {
return nil, err