Test_BasicAuth_UTF8Normalization() — fiber Function Reference
Architecture documentation for the Test_BasicAuth_UTF8Normalization() function in basicauth_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD 92d2a549_7354_b2bc_2daf_98b0bbc99ec9["Test_BasicAuth_UTF8Normalization()"] c1fa52c0_acd4_56de_8c46_542417f3c9b8["basicauth_test.go"] 92d2a549_7354_b2bc_2daf_98b0bbc99ec9 -->|defined in| c1fa52c0_acd4_56de_8c46_542417f3c9b8 style 92d2a549_7354_b2bc_2daf_98b0bbc99ec9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/basicauth/basicauth_test.go lines 347–370
func Test_BasicAuth_UTF8Normalization(t *testing.T) {
t.Parallel()
app := fiber.New()
decomposed := "e\u0301" // e + combining acute accent
called := false
app.Use(New(Config{
Charset: "UTF-8",
Authorizer: func(u, p string, _ fiber.Ctx) bool {
called = true
require.Equal(t, "é", u)
require.Equal(t, "doe", p)
return true
},
}))
app.Get("/", func(c fiber.Ctx) error { return c.SendStatus(fiber.StatusTeapot) })
creds := base64.StdEncoding.EncodeToString([]byte(decomposed + ":doe"))
req := httptest.NewRequest(fiber.MethodGet, "/", http.NoBody)
req.Header.Set(fiber.HeaderAuthorization, "Basic "+creds)
resp, err := app.Test(req)
require.NoError(t, err)
require.Equal(t, fiber.StatusTeapot, resp.StatusCode)
require.True(t, called)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_BasicAuth_UTF8Normalization() do?
Test_BasicAuth_UTF8Normalization() is a function in the fiber codebase, defined in middleware/basicauth/basicauth_test.go.
Where is Test_BasicAuth_UTF8Normalization() defined?
Test_BasicAuth_UTF8Normalization() is defined in middleware/basicauth/basicauth_test.go at line 347.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free