MCPcopy
hub / github.com/gofiber/fiber / Test_HSTSPreloadIncludesSubdomains

Function Test_HSTSPreloadIncludesSubdomains

middleware/helmet/helmet_test.go:263–270  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

261}
262
263func Test_HSTSPreloadIncludesSubdomains(t *testing.T) {
264 t.Parallel()
265
266 require.Equal(t, "max-age=31536000; includeSubDomains; preload", hstsHeaderForRequest(t, &Config{
267 HSTSMaxAge: 31536000,
268 HSTSPreloadEnabled: true,
269 }, "https"))
270}
271
272func hstsHeaderForRequest(t *testing.T, config *Config, scheme string) string {
273 t.Helper()

Callers

nothing calls this directly

Calls 1

hstsHeaderForRequestFunction · 0.85

Tested by

no test coverage detected