From 937c0dc46c3472f8321462fbe176b27e3a3448fd Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Tue, 2 Jul 2024 16:46:56 -0400 Subject: [PATCH] CLOUDFLARE: Fix another redirect bug (#3034) --- providers/cloudflare/singleredirect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/cloudflare/singleredirect.go b/providers/cloudflare/singleredirect.go index 7c49815e5a..71d67012dd 100644 --- a/providers/cloudflare/singleredirect.go +++ b/providers/cloudflare/singleredirect.go @@ -149,7 +149,7 @@ func makeRuleFromPattern(pattern, replacement string, temporary bool) (string, s expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost) } else if strings.Count(host, `*`) == 1 && strings.Count(path, `*`) == 1 && - strings.Count(replacement, `$`) == 1 && strings.HasPrefix(rpath, `/$2`) { + strings.Count(replacement, `$`) == 1 && strings.HasSuffix(rpath, `/$2`) { // https://careers.stackoverflow.com/$2 expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)