MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / TestNoCache

Function TestNoCache

pkg/webmiddleware/cache_headers_test.go:27–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestNoCache(t *testing.T) {
28 a := assertions.New(t)
29
30 r := httptest.NewRequest(http.MethodGet, "/", nil)
31
32 rec := httptest.NewRecorder()
33 NoCache(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
34 })).ServeHTTP(rec, r)
35 res := rec.Result()
36
37 a.So(res.Header.Get("Cache-Control"), should.Equal, "no-store")
38 a.So(res.Header.Get("Pragma"), should.Equal, "no-cache")
39}

Callers

nothing calls this directly

Calls 5

NoCacheFunction · 0.85
NewMethod · 0.65
ResultMethod · 0.65
GetMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected