diff options
author | mister-turtle <[email protected]> | 2024-09-13 08:22:03 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-13 03:22:03 -0400 |
commit | 21f9c20a04ec5c2ac430daa8e4ba8fbdef67f773 (patch) | |
tree | 9b68dbc1c72749232f208b409049fc960365c192 /modules | |
parent | 2d12fb7ac6c7dfcbb8abeafbfb64af5ad1175bb3 (diff) | |
download | caddy-21f9c20a04ec5c2ac430daa8e4ba8fbdef67f773.tar.gz caddy-21f9c20a04ec5c2ac430daa8e4ba8fbdef67f773.zip |
rewrite: Avoid panic on bad arg count for `uri` (#6571)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/rewrite/caddyfile.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go index 0ce5c41d2..89f44c79b 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] |