Home / Function/ Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() — fiber Function Reference

Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() — fiber Function Reference

Architecture documentation for the Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() function in app_integration_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  edb8ad64_1023_c9ce_acf8_372f2d55fd73["Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit()"]
  861529d8_c77d_779c_a04e_384693fbcc82["app_integration_test.go"]
  edb8ad64_1023_c9ce_acf8_372f2d55fd73 -->|defined in| 861529d8_c77d_779c_a04e_384693fbcc82
  89ef89e1_149f_b4b2_0c6a_e8967b8441b2["performOversizedRequest()"]
  edb8ad64_1023_c9ce_acf8_372f2d55fd73 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  style edb8ad64_1023_c9ce_acf8_372f2d55fd73 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

app_integration_test.go lines 504–522

func Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit(t *testing.T) {
	app := fiber.New(fiber.Config{BodyLimit: 16})
	app.Use(cors.New(cors.Config{
		AllowOrigins:     []string{"https://example.com"},
		AllowCredentials: true,
		ExposeHeaders:    []string{"X-Request-ID"},
	}))
	app.Post("/", func(c fiber.Ctx) error {
		return c.SendStatus(fiber.StatusOK)
	})

	resp := performOversizedRequest(t, app, nil)

	require.Equal(t, fiber.StatusRequestEntityTooLarge, resp.StatusCode())
	require.Equal(t, "https://example.com", string(resp.Header.Peek(fiber.HeaderAccessControlAllowOrigin)))
	require.Equal(t, "true", string(resp.Header.Peek(fiber.HeaderAccessControlAllowCredentials)))
	require.Equal(t, "X-Request-ID", string(resp.Header.Peek(fiber.HeaderAccessControlExposeHeaders)))
	require.Equal(t, "Origin", string(resp.Header.Peek(fiber.HeaderVary)))
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() do?
Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() is a function in the fiber codebase, defined in app_integration_test.go.
Where is Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() defined?
Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() is defined in app_integration_test.go at line 504.
What does Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() call?
Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit() calls 1 function(s): performOversizedRequest.

Analyze Your Own Codebase

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

Try Supermodel Free