From 25dea2903e613534e00a2a4e305e0c8f2daeea8d Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 11 Jan 2020 13:47:42 -0700 Subject: http: A little more polish on rewrite handler and try_files directive --- modules/caddyhttp/rewrite/caddyfile.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/caddyhttp/rewrite/caddyfile.go') diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go index 368db15..6ec51c0 100644 --- a/modules/caddyhttp/rewrite/caddyfile.go +++ b/modules/caddyhttp/rewrite/caddyfile.go @@ -32,7 +32,8 @@ func init() { // // rewrite [] // -// The parameter becomes the new URI. +// Only URI components which are given in will be set in the resulting URI. +// See the docs for the rewrite handler for more information. func parseCaddyfileRewrite(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) { var rewr Rewrite for h.Next() { @@ -58,7 +59,7 @@ func parseCaddyfileStripPrefix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand if !h.NextArg() { return nil, h.ArgErr() } - rewr.StripPrefix = h.Val() + rewr.StripPathPrefix = h.Val() if h.NextArg() { return nil, h.ArgErr() } @@ -77,7 +78,7 @@ func parseCaddyfileStripSuffix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand if !h.NextArg() { return nil, h.ArgErr() } - rewr.StripSuffix = h.Val() + rewr.StripPathSuffix = h.Val() if h.NextArg() { return nil, h.ArgErr() } -- cgit v1.2.3