Home / Function/ Test_CORS_Preserve_Origin_Case() — fiber Function Reference

Test_CORS_Preserve_Origin_Case() — fiber Function Reference

Architecture documentation for the Test_CORS_Preserve_Origin_Case() function in cors_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  bd492714_d28a_5c25_8188_ccaca354b600["Test_CORS_Preserve_Origin_Case()"]
  e59a43fd_cfa4_0f6b_1938_4a08e36ad74e["cors_test.go"]
  bd492714_d28a_5c25_8188_ccaca354b600 -->|defined in| e59a43fd_cfa4_0f6b_1938_4a08e36ad74e
  style bd492714_d28a_5c25_8188_ccaca354b600 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/cors/cors_test.go lines 87–102

func Test_CORS_Preserve_Origin_Case(t *testing.T) {
	t.Parallel()

	app := fiber.New()
	app.Use(New(Config{AllowOrigins: []string{"http://example.com"}}))

	origin := "HTTP://EXAMPLE.COM"

	ctx := &fasthttp.RequestCtx{}
	ctx.Request.Header.SetMethod(fiber.MethodOptions)
	ctx.Request.Header.Set(fiber.HeaderAccessControlRequestMethod, fiber.MethodGet)
	ctx.Request.Header.Set(fiber.HeaderOrigin, origin)
	app.Handler()(ctx)

	require.Equal(t, origin, string(ctx.Response.Header.Peek(fiber.HeaderAccessControlAllowOrigin)))
}

Domain

Subdomains

Frequently Asked Questions

What does Test_CORS_Preserve_Origin_Case() do?
Test_CORS_Preserve_Origin_Case() is a function in the fiber codebase, defined in middleware/cors/cors_test.go.
Where is Test_CORS_Preserve_Origin_Case() defined?
Test_CORS_Preserve_Origin_Case() is defined in middleware/cors/cors_test.go at line 87.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free