You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-27 00:51:33 +02:00
found another edge case to test
This commit is contained in:
16
http_test.go
16
http_test.go
@ -87,3 +87,19 @@ func TestGCPHealthcheckNotIngress(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, "test", rw.Body.String())
|
assert.Equal(t, "test", rw.Body.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGCPHealthcheckNotIngressPut(t *testing.T) {
|
||||||
|
handler := func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
w.Write([]byte("test"))
|
||||||
|
}
|
||||||
|
|
||||||
|
h := gcpHealthcheck(http.HandlerFunc(handler))
|
||||||
|
rw := httptest.NewRecorder()
|
||||||
|
r, _ := http.NewRequest("PUT", "/", nil)
|
||||||
|
r.RemoteAddr = "127.0.0.1"
|
||||||
|
r.Host = "test-server"
|
||||||
|
r.Header.Set(userAgentHeader, googleHealthCheckUserAgent)
|
||||||
|
h.ServeHTTP(rw, r)
|
||||||
|
|
||||||
|
assert.Equal(t, "test", rw.Body.String())
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user