CLOUDFLARE: Fix another redirect bug (#3034)

This commit is contained in:
Tom Limoncelli 2024-07-02 16:46:56 -04:00 committed by GitHub
parent a091da9067
commit 937c0dc46c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)