From 5823eccf99d9fc6b4ffba8a78acfdb59c4ec0c97 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Tue, 5 Nov 2024 12:15:31 -0500 Subject: rewrite: Don't add / in Caddyfile, do it after replacer (#6662) --- modules/caddyhttp/rewrite/caddyfile.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'modules/caddyhttp/rewrite/caddyfile.go') diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go index 89f44c79b..5f9b97adf 100644 --- a/modules/caddyhttp/rewrite/caddyfile.go +++ b/modules/caddyhttp/rewrite/caddyfile.go @@ -110,9 +110,6 @@ func parseCaddyfileURI(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, err return nil, h.ArgErr() } rewr.StripPathPrefix = args[1] - if !strings.HasPrefix(rewr.StripPathPrefix, "/") { - rewr.StripPathPrefix = "/" + rewr.StripPathPrefix - } case "strip_suffix": if len(args) != 2 { -- cgit v1.2.3