Skip to content

Commit

Permalink
CLOUDFLARE: Bugfix for Redirect, correct typo in error message. (#3033)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhang-sre authored Jul 2, 2024
1 parent 5ef1e99 commit a091da9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/cloudflare/singleredirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && rpath == `/$2` {
strings.Count(replacement, `$`) == 1 && strings.HasPrefix(rpath, `/$2`) {
// https://careers.stackoverflow.com/$2
expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)

Expand All @@ -165,7 +165,7 @@ func makeRuleFromPattern(pattern, replacement string, temporary bool) (string, s
return "", "", fmt.Errorf("conversion not implemented for pattern: %s", origPattern)
}
if expr == "" {
return "", "", fmt.Errorf("conversion not implemented for replacemennt: %s", origReplacement)
return "", "", fmt.Errorf("conversion not implemented for replacement: %s", origReplacement)
}

return matcher, expr, nil
Expand Down

0 comments on commit a091da9

Please sign in to comment.