ifthen
This commit is contained in:
@@ -160,7 +160,23 @@ func (c *Config) endpoint(r *http.Request) Endpoint {
|
||||
if !ok {
|
||||
return Endpoint{}
|
||||
}
|
||||
return m[key]
|
||||
|
||||
endpoint, ok := m[key]
|
||||
if !ok {
|
||||
return Endpoint{}
|
||||
}
|
||||
|
||||
for _, iffer := range endpoint.If {
|
||||
matches := true
|
||||
for k, v := range iffer.Headers {
|
||||
matches = matches && r.Header.Get(k) == v
|
||||
}
|
||||
if matches {
|
||||
return iffer.Then
|
||||
}
|
||||
}
|
||||
|
||||
return endpoint
|
||||
}
|
||||
|
||||
type redirPurge struct {
|
||||
|
||||
Reference in New Issue
Block a user