mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
proxy: fix bug with incorrect addressing causing invalid route configs
This commit is contained in:
parent
2eb2eb0620
commit
9992eebcac
2 changed files with 3 additions and 3 deletions
|
@ -325,7 +325,7 @@ func (p *Proxy) Authenticate(w http.ResponseWriter, r *http.Request) (err error)
|
||||||
func (p *Proxy) Handle(host string, handler http.Handler, pol *policy.Policy) {
|
func (p *Proxy) Handle(host string, handler http.Handler, pol *policy.Policy) {
|
||||||
p.routeConfigs[host] = &routeConfig{
|
p.routeConfigs[host] = &routeConfig{
|
||||||
mux: handler,
|
mux: handler,
|
||||||
policy: pol,
|
policy: *pol,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ func (p *Proxy) router(r *http.Request) (http.Handler, bool) {
|
||||||
func (p *Proxy) policy(r *http.Request) (*policy.Policy, bool) {
|
func (p *Proxy) policy(r *http.Request) (*policy.Policy, bool) {
|
||||||
config, ok := p.routeConfigs[r.Host]
|
config, ok := p.routeConfigs[r.Host]
|
||||||
if ok {
|
if ok {
|
||||||
return config.policy, true
|
return &config.policy, true
|
||||||
}
|
}
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ type Proxy struct {
|
||||||
|
|
||||||
type routeConfig struct {
|
type routeConfig struct {
|
||||||
mux http.Handler
|
mux http.Handler
|
||||||
policy *policy.Policy
|
policy policy.Policy
|
||||||
}
|
}
|
||||||
|
|
||||||
// New takes a Proxy service from options and a validation function.
|
// New takes a Proxy service from options and a validation function.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue