Home / Function/ Test_Integration_App_ServerErrorHandler_WithCustomCtx() — fiber Function Reference

Test_Integration_App_ServerErrorHandler_WithCustomCtx() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

app_integration_test.go lines 599–619

func Test_Integration_App_ServerErrorHandler_WithCustomCtx(t *testing.T) {
	app := fiber.NewWithCustomCtx(newIntegrationCustomCtx, fiber.Config{BodyLimit: 16})
	app.Use(func(c fiber.Ctx) error {
		customCtx, ok := c.(*integrationCustomCtx)
		require.True(t, ok)
		customCtx.Set("X-Custom-Ctx", "true")
		return c.Next()
	})
	app.Use(cors.New(cors.Config{AllowOrigins: []string{"https://example.org"}}))
	app.Post("/", func(c fiber.Ctx) error {
		return c.SendStatus(fiber.StatusOK)
	})

	resp := performOversizedRequest(t, app, func(req *fasthttp.Request) {
		req.Header.Set(fiber.HeaderOrigin, "https://example.org")
	})

	require.Equal(t, fiber.StatusRequestEntityTooLarge, resp.StatusCode())
	require.Equal(t, "true", string(resp.Header.Peek("X-Custom-Ctx")))
	require.Equal(t, "https://example.org", string(resp.Header.Peek(fiber.HeaderAccessControlAllowOrigin)))
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Integration_App_ServerErrorHandler_WithCustomCtx() do?
Test_Integration_App_ServerErrorHandler_WithCustomCtx() is a function in the fiber codebase, defined in app_integration_test.go.
Where is Test_Integration_App_ServerErrorHandler_WithCustomCtx() defined?
Test_Integration_App_ServerErrorHandler_WithCustomCtx() is defined in app_integration_test.go at line 599.
What does Test_Integration_App_ServerErrorHandler_WithCustomCtx() call?
Test_Integration_App_ServerErrorHandler_WithCustomCtx() 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