summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormister-turtle <50653342+mister-turtle@users.noreply.github.com>2024-09-13 08:22:03 +0100
committerGitHub <noreply@github.com>2024-09-13 03:22:03 -0400
commit21f9c20a04ec5c2ac430daa8e4ba8fbdef67f773 (patch)
tree9b68dbc1c72749232f208b409049fc960365c192
parent2d12fb7ac6c7dfcbb8abeafbfb64af5ad1175bb3 (diff)
rewrite: Avoid panic on bad arg count for `uri` (#6571)
-rw-r--r--modules/caddyhttp/rewrite/caddyfile.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go
index 0ce5c41d..89f44c79 100644
--- a/modules/caddyhttp/rewrite/caddyfile.go
+++ b/modules/caddyhttp/rewrite/caddyfile.go
@@ -106,7 +106,7 @@ func parseCaddyfileURI(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, err
switch args[0] {
case "strip_prefix":
- if len(args) > 2 {
+ if len(args) != 2 {
return nil, h.ArgErr()
}
rewr.StripPathPrefix = args[1]
@@ -115,7 +115,7 @@ func parseCaddyfileURI(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, err
}
case "strip_suffix":
- if len(args) > 2 {
+ if len(args) != 2 {
return nil, h.ArgErr()
}
rewr.StripPathSuffix = args[1]