mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-09 13:46:07 +08:00
CLOUDFLARE: Bugfix for Redirect, correct typo in error message. (#3033)
This commit is contained in:
parent
5ef1e9979b
commit
a091da9067
1 changed files with 2 additions and 2 deletions
|
|
@ -149,7 +149,7 @@ func makeRuleFromPattern(pattern, replacement string, temporary bool) (string, s
|
||||||
expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)
|
expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)
|
||||||
|
|
||||||
} else if strings.Count(host, `*`) == 1 && strings.Count(path, `*`) == 1 &&
|
} 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
|
// https://careers.stackoverflow.com/$2
|
||||||
expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)
|
expr = fmt.Sprintf(`concat("https://%s", http.request.uri.path)`, rhost)
|
||||||
|
|
||||||
|
|
@ -165,7 +165,7 @@ func makeRuleFromPattern(pattern, replacement string, temporary bool) (string, s
|
||||||
return "", "", fmt.Errorf("conversion not implemented for pattern: %s", origPattern)
|
return "", "", fmt.Errorf("conversion not implemented for pattern: %s", origPattern)
|
||||||
}
|
}
|
||||||
if expr == "" {
|
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
|
return matcher, expr, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue