httputil/reproxy: fix policy transport (#3322)

This commit is contained in:
Caleb Doxsey 2022-05-05 00:32:36 +00:00 committed by GitHub
parent a2d2f34e24
commit 6b663ba53f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -37,6 +37,13 @@ func TestHTTPTransport(t *testing.T) {
}
func TestPolicyHTTPTransport(t *testing.T) {
originalTransport := http.DefaultTransport
defer func() {
http.DefaultTransport = originalTransport
}()
src := NewStaticSource(&Config{Options: &Options{}})
http.DefaultTransport = NewHTTPTransport(src)
s := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))