Test_ContentSecurityPolicy() — fiber Function Reference
Architecture documentation for the Test_ContentSecurityPolicy() function in helmet_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD b7822b48_0a3a_7547_e263_032c8c540063["Test_ContentSecurityPolicy()"] dc893b58_cc7a_94e6_441a_587c6543a0cd["helmet_test.go"] b7822b48_0a3a_7547_e263_032c8c540063 -->|defined in| dc893b58_cc7a_94e6_441a_587c6543a0cd style b7822b48_0a3a_7547_e263_032c8c540063 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/helmet/helmet_test.go lines 155–169
func Test_ContentSecurityPolicy(t *testing.T) {
app := fiber.New()
app.Use(New(Config{
ContentSecurityPolicy: "default-src 'none'",
}))
app.Get("/", func(c fiber.Ctx) error {
return c.SendString("Hello, World!")
})
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
require.NoError(t, err)
require.Equal(t, "default-src 'none'", resp.Header.Get(fiber.HeaderContentSecurityPolicy))
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_ContentSecurityPolicy() do?
Test_ContentSecurityPolicy() is a function in the fiber codebase, defined in middleware/helmet/helmet_test.go.
Where is Test_ContentSecurityPolicy() defined?
Test_ContentSecurityPolicy() is defined in middleware/helmet/helmet_test.go at line 155.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free