MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / Test_prepareNoCache

Function Test_prepareNoCache

oauthproxy_test.go:1983–1997  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1981}
1982
1983func Test_prepareNoCache(t *testing.T) {
1984 handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1985 prepareNoCache(w)
1986 })
1987 mux := http.NewServeMux()
1988 mux.Handle("/", handler)
1989
1990 rec := httptest.NewRecorder()
1991 req := httptest.NewRequest(http.MethodGet, "/", nil)
1992 mux.ServeHTTP(rec, req)
1993
1994 for k, v := range noCacheHeaders {
1995 assert.Equal(t, rec.Header().Get(k), v)
1996 }
1997}
1998
1999func Test_noCacheHeaders(t *testing.T) {
2000 upstreamServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

prepareNoCacheFunction · 0.85
GetMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected