mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
proxy: Fix policy reload regression (#396)
* Fix policy reload regression * Update changelog
This commit is contained in:
parent
8164cfd85a
commit
f20d913abe
4 changed files with 10 additions and 2 deletions
|
@ -136,7 +136,7 @@ func newProxyService(opt config.Options, r *mux.Router) (*proxy.Proxy, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
r.PathPrefix("/").Handler(service.Handler)
|
r.PathPrefix("/").Handler(service)
|
||||||
return service, nil
|
return service, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
|
|
||||||
- Added yaml tags to all options structs [GH-394](https://github.com/pomerium/pomerium/pull/394)
|
- Added yaml tags to all options structs [GH-394](https://github.com/pomerium/pomerium/pull/394)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed regression preventing policy reload [GH-396](https://github.com/pomerium/pomerium/pull/396)
|
||||||
|
|
||||||
## v0.5.0
|
## v0.5.0
|
||||||
|
|
||||||
### New
|
### New
|
||||||
|
|
|
@ -302,3 +302,7 @@ func (p *Proxy) roundTripperFromPolicy(policy *config.Policy) http.RoundTripper
|
||||||
}
|
}
|
||||||
return c.Then(transport)
|
return c.Then(transport)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
p.Handler.ServeHTTP(w, r)
|
||||||
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ func Test_UpdateOptions(t *testing.T) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
r := httptest.NewRequest("GET", tt.host, nil)
|
r := httptest.NewRequest("GET", tt.host, nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
p.Handler.ServeHTTP(w, r)
|
p.ServeHTTP(w, r)
|
||||||
if tt.wantRoute && w.Code != http.StatusNotFound {
|
if tt.wantRoute && w.Code != http.StatusNotFound {
|
||||||
t.Errorf("Failed to find route handler")
|
t.Errorf("Failed to find route handler")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue