mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
config: support multiple destination addresses (#1789)
* config: support multiple destination addresses * use constructor for string slice * add docs * add test for multiple destinations * fix name
This commit is contained in:
parent
c6b6141d12
commit
a4c7381eba
22 changed files with 556 additions and 191 deletions
|
@ -404,8 +404,8 @@ func getRewriteOptions(policy *config.Policy) (prefixRewrite string, regexRewrit
|
|||
},
|
||||
Substitution: policy.RegexRewriteSubstitution,
|
||||
}
|
||||
} else if policy.Destination != nil && policy.Destination.Path != "" {
|
||||
prefixRewrite = policy.Destination.Path
|
||||
} else if len(policy.Destinations) > 0 && policy.Destinations[0].Path != "" {
|
||||
prefixRewrite = policy.Destinations[0].Path
|
||||
}
|
||||
|
||||
return prefixRewrite, regexRewrite
|
||||
|
@ -460,3 +460,11 @@ func mustParseURL(str string) *url.URL {
|
|||
}
|
||||
return u
|
||||
}
|
||||
|
||||
func mustParseURLs(strs ...string) []*url.URL {
|
||||
var us []*url.URL
|
||||
for _, str := range strs {
|
||||
us = append(us, mustParseURL(str))
|
||||
}
|
||||
return us
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue