@marcel91200 / caddy Mirror · read-only / commits / 21f9c20a
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 08:15 UTC

rewrite: Avoid panic on bad arg count for `uri` (#6571)

mister-turtle committed Sep 13, 2024 at 08:22 UTC 21f9c20a04ec5c2ac430daa8e4ba8fbdef67f773
1 file changed +2 -2
modules/caddyhttp/rewrite/caddyfile.go
+2 -2
@@ -106,7 +106,7 @@ func parseCaddyfileURI(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, err
106
107 switch args[0] {
108 case "strip_prefix":
109 - if len(args) > 2 {
109 + if len(args) != 2 {
110 return nil, h.ArgErr()
111 }
112 rewr.StripPathPrefix = args[1]
@@ -115,7 +115,7 @@ func parseCaddyfileURI(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, err
115 }
116
117 case "strip_suffix":
118 - if len(args) > 2 {
118 + if len(args) != 2 {
119 return nil, h.ArgErr()
120 }
121 rewr.StripPathSuffix = args[1]