mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
rewrite: Avoid panic on bad arg count for uri
(#6571)
This commit is contained in:
parent
2d12fb7ac6
commit
21f9c20a04
1 changed files with 2 additions and 2 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue