proxy: Fix policy reload regression (#396)

* Fix policy reload regression

* Update changelog
This commit is contained in:
Travis Groth 2019-11-22 19:28:36 -05:00 committed by GitHub
parent 8164cfd85a
commit f20d913abe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View file

@ -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
} }

View file

@ -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

View file

@ -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)
}

View file

@ -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