summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/forwardauth
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-02-25 19:34:27 -0500
committerGitHub <noreply@github.com>2023-02-26 00:34:27 +0000
commit960150bb034dc9a549ee7289b1a4eb4abafeb30a (patch)
treea3608546db0b154a75afc3dae2d52d44b92ceac9 /modules/caddyhttp/reverseproxy/forwardauth
parent9e6919550be5689628d0020ec14e90ea6f527716 (diff)
caddyfile: Implement heredoc support (#5385)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/forwardauth')
-rw-r--r--modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go b/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go
index cecc000..dbd2a29 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 {