mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-03 11:22:45 +02:00
config: gofmt
This commit is contained in:
parent
d6591e4109
commit
5ecfa34361
2 changed files with 3 additions and 4 deletions
|
@ -26,8 +26,8 @@ type Policy struct {
|
||||||
|
|
||||||
// Additional route matching options
|
// Additional route matching options
|
||||||
Prefix string `mapstructure:"prefix" yaml:"prefix,omitempty" json:"prefix,omitempty"`
|
Prefix string `mapstructure:"prefix" yaml:"prefix,omitempty" json:"prefix,omitempty"`
|
||||||
Path string `mapstructure:"path" yaml:"path,omitempty" json:"path,omitempty"`
|
Path string `mapstructure:"path" yaml:"path,omitempty" json:"path,omitempty"`
|
||||||
Regex string `mapstructure:"regex" yaml:"regex,omitempty" json:"regex,omitempty"`
|
Regex string `mapstructure:"regex" yaml:"regex,omitempty" json:"regex,omitempty"`
|
||||||
|
|
||||||
// Allow unauthenticated HTTP OPTIONS requests as per the CORS spec
|
// Allow unauthenticated HTTP OPTIONS requests as per the CORS spec
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests
|
||||||
|
|
|
@ -326,7 +326,6 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
p.Handler.ServeHTTP(w, r)
|
p.Handler.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// routeMatcherFuncFromPolicy returns a mux matcher function which compares an http request with a policy.
|
// routeMatcherFuncFromPolicy returns a mux matcher function which compares an http request with a policy.
|
||||||
//
|
//
|
||||||
// Routes can be filtered by the `source`, `prefix`, `path` and `regex` fields in the policy config.
|
// Routes can be filtered by the `source`, `prefix`, `path` and `regex` fields in the policy config.
|
||||||
|
@ -365,4 +364,4 @@ func routeMatcherFuncFromPolicy(policy config.Policy) mux.MatcherFunc {
|
||||||
return func(r *http.Request, rm *mux.RouteMatch) bool {
|
return func(r *http.Request, rm *mux.RouteMatch) bool {
|
||||||
return sourceMatches(r) && prefixMatches(r) && pathMatches(r) && regexMatches(r)
|
return sourceMatches(r) && prefixMatches(r) && pathMatches(r) && regexMatches(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue