Home / Function/ performOversizedRequest() — fiber Function Reference

performOversizedRequest() — fiber Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  89ef89e1_149f_b4b2_0c6a_e8967b8441b2["performOversizedRequest()"]
  861529d8_c77d_779c_a04e_384693fbcc82["app_integration_test.go"]
  89ef89e1_149f_b4b2_0c6a_e8967b8441b2 -->|defined in| 861529d8_c77d_779c_a04e_384693fbcc82
  e559ad37_9b70_8e8c_26c1_2873d75257dd["Test_Integration_App_ServerErrorHandler_MiddlewareCombinationHeaders()"]
  e559ad37_9b70_8e8c_26c1_2873d75257dd -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  edb8ad64_1023_c9ce_acf8_372f2d55fd73["Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit()"]
  edb8ad64_1023_c9ce_acf8_372f2d55fd73 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  4ecdd628_c317_28ac_fa55_8cb012a9e792["Test_Integration_App_ServerErrorHandler_PreservesHelmetHeadersOnBodyLimit()"]
  4ecdd628_c317_28ac_fa55_8cb012a9e792 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  9477fd03_7447_0f8c_8578_be2f15ecc639["Test_Integration_App_ServerErrorHandler_PreservesRequestID()"]
  9477fd03_7447_0f8c_8578_be2f15ecc639 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  d02d3d15_42f7_afd8_392a_8cc04d2c753f["Test_Integration_App_ServerErrorHandler_GroupMiddlewareChain()"]
  d02d3d15_42f7_afd8_392a_8cc04d2c753f -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  35fd00ad_0482_df53_2afd_f71346fcae24["Test_Integration_App_ServerErrorHandler_RetainsHeadersFromSubsequentMiddleware()"]
  35fd00ad_0482_df53_2afd_f71346fcae24 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  60c8e22d_3eeb_a562_cf15_f9aebb03a882["Test_Integration_App_ServerErrorHandler_WithCustomCtx()"]
  60c8e22d_3eeb_a562_cf15_f9aebb03a882 -->|calls| 89ef89e1_149f_b4b2_0c6a_e8967b8441b2
  style 89ef89e1_149f_b4b2_0c6a_e8967b8441b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

app_integration_test.go lines 40–98

func performOversizedRequest(t *testing.T, app *fiber.App, configure func(req *fasthttp.Request)) *fasthttp.Response {
	t.Helper()

	ln := fasthttputil.NewInmemoryListener()
	errCh := make(chan error, 1)

	go func() {
		errCh <- app.Listener(ln, fiber.ListenConfig{DisableStartupMessage: true})
	}()

	t.Cleanup(func() {
		require.NoError(t, app.Shutdown())
		if err := <-errCh; err != nil && !errors.Is(err, net.ErrClosed) {
			require.NoError(t, err)
		}
	})

	require.Eventually(t, func() bool {
		conn, err := ln.Dial()
		if err != nil {
			return false
		}
		if err := conn.Close(); err != nil {
			return false
		}
		return true
	}, time.Second, 10*time.Millisecond)

	req := fasthttp.AcquireRequest()
	resp := fasthttp.AcquireResponse()

	req.SetRequestURI("http://example.com/")
	req.Header.SetMethod(fiber.MethodPost)
	req.Header.Set(fiber.HeaderOrigin, "https://example.com")
	req.SetBody(bytes.Repeat([]byte{'a'}, 32))
	if configure != nil {
		configure(req)
	}

	client := fasthttp.Client{
		Dial: func(string) (net.Conn, error) {
			return ln.Dial()
		},
	}

	require.NoError(t, client.Do(req, resp))

	respCopy := fasthttp.AcquireResponse()
	resp.CopyTo(respCopy)

	fasthttp.ReleaseRequest(req)
	fasthttp.ReleaseResponse(resp)

	t.Cleanup(func() {
		fasthttp.ReleaseResponse(respCopy)
	})

	return respCopy
}

Domain

Subdomains

Frequently Asked Questions

What does performOversizedRequest() do?
performOversizedRequest() is a function in the fiber codebase, defined in app_integration_test.go.
Where is performOversizedRequest() defined?
performOversizedRequest() is defined in app_integration_test.go at line 40.
What calls performOversizedRequest()?
performOversizedRequest() is called by 7 function(s): Test_Integration_App_ServerErrorHandler_GroupMiddlewareChain, Test_Integration_App_ServerErrorHandler_MiddlewareCombinationHeaders, Test_Integration_App_ServerErrorHandler_PreservesCORSHeadersOnBodyLimit, Test_Integration_App_ServerErrorHandler_PreservesHelmetHeadersOnBodyLimit, Test_Integration_App_ServerErrorHandler_PreservesRequestID, Test_Integration_App_ServerErrorHandler_RetainsHeadersFromSubsequentMiddleware, Test_Integration_App_ServerErrorHandler_WithCustomCtx.

Analyze Your Own Codebase

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

Try Supermodel Free