rewrite: Rename parameters; implement custom query string parser

Our new parser also preserves original parameter order, rather than
re-encoding using the std lib (which sorts).

The renamed parameters are a breaking change but they're new enough
that I don't think anyone is using them.
This commit is contained in:
Matthew Holt
2020-01-10 16:59:57 -07:00
parent ba514f9660
commit d418e319ab
3 changed files with 104 additions and 56 deletions

View File

@ -58,7 +58,7 @@ func parseCaddyfileStripPrefix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand
if !h.NextArg() {
return nil, h.ArgErr()
}
rewr.StripPathPrefix = h.Val()
rewr.StripPrefix = h.Val()
if h.NextArg() {
return nil, h.ArgErr()
}
@ -77,7 +77,7 @@ func parseCaddyfileStripSuffix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand
if !h.NextArg() {
return nil, h.ArgErr()
}
rewr.StripPathSuffix = h.Val()
rewr.StripSuffix = h.Val()
if h.NextArg() {
return nil, h.ArgErr()
}