Test_ProxyAuthenticateHeader() — fiber Function Reference
Architecture documentation for the Test_ProxyAuthenticateHeader() function in keyauth_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD 66a42de0_ce38_4c9b_9597_ca0383f8de07["Test_ProxyAuthenticateHeader()"] 71f55784_a001_0646_0ce7_7ad97067c49c["keyauth_test.go"] 66a42de0_ce38_4c9b_9597_ca0383f8de07 -->|defined in| 71f55784_a001_0646_0ce7_7ad97067c49c style 66a42de0_ce38_4c9b_9597_ca0383f8de07 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/keyauth/keyauth_test.go lines 1047–1064
func Test_ProxyAuthenticateHeader(t *testing.T) {
app := fiber.New()
app.Use(New(Config{
Validator: func(_ fiber.Ctx, _ string) (bool, error) { return false, errors.New("invalid") },
ErrorHandler: func(c fiber.Ctx, _ error) error {
return c.Status(fiber.StatusProxyAuthRequired).SendString("proxy auth")
},
}))
app.Get("/", func(c fiber.Ctx) error { return c.SendString("OK") })
req := httptest.NewRequest(fiber.MethodGet, "/", http.NoBody)
req.Header.Add("Authorization", "Bearer bad")
res, err := app.Test(req)
require.NoError(t, err)
require.Equal(t, http.StatusProxyAuthRequired, res.StatusCode)
require.Equal(t, `Bearer realm="Restricted"`, res.Header.Get(fiber.HeaderProxyAuthenticate))
require.Empty(t, res.Header.Get(fiber.HeaderWWWAuthenticate))
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_ProxyAuthenticateHeader() do?
Test_ProxyAuthenticateHeader() is a function in the fiber codebase, defined in middleware/keyauth/keyauth_test.go.
Where is Test_ProxyAuthenticateHeader() defined?
Test_ProxyAuthenticateHeader() is defined in middleware/keyauth/keyauth_test.go at line 1047.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free