Home / Function/ Test_Proxy_DoRedirects_TooManyRedirects() — fiber Function Reference

Test_Proxy_DoRedirects_TooManyRedirects() — fiber Function Reference

Architecture documentation for the Test_Proxy_DoRedirects_TooManyRedirects() function in proxy_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  202597e7_924f_1a70_e84a_84b6d5a52f6c["Test_Proxy_DoRedirects_TooManyRedirects()"]
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2["proxy_test.go"]
  202597e7_924f_1a70_e84a_84b6d5a52f6c -->|defined in| a7c70172_e40a_6ad6_65b6_b8f508cfb0a2
  188b57dc_09d5_e4f7_7fbc_66e91710cb07["createRedirectServer()"]
  202597e7_924f_1a70_e84a_84b6d5a52f6c -->|calls| 188b57dc_09d5_e4f7_7fbc_66e91710cb07
  style 202597e7_924f_1a70_e84a_84b6d5a52f6c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 596–615

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

	addr := createRedirectServer(t)
	app := fiber.New()
	app.Get("/test", func(c fiber.Ctx) error {
		return DoRedirects(c, "http://"+addr, 0)
	})

	resp, err1 := app.Test(httptest.NewRequest(fiber.MethodGet, "/test", http.NoBody), fiber.TestConfig{
		Timeout:       2 * time.Second,
		FailOnTimeout: true,
	})
	require.NoError(t, err1)
	body, err := io.ReadAll(resp.Body)
	require.NoError(t, err)
	require.Equal(t, "too many redirects detected when doing the request", string(body))
	require.Equal(t, fiber.StatusInternalServerError, resp.StatusCode)
	require.Equal(t, "/test", resp.Request.URL.String())
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Proxy_DoRedirects_TooManyRedirects() do?
Test_Proxy_DoRedirects_TooManyRedirects() is a function in the fiber codebase, defined in middleware/proxy/proxy_test.go.
Where is Test_Proxy_DoRedirects_TooManyRedirects() defined?
Test_Proxy_DoRedirects_TooManyRedirects() is defined in middleware/proxy/proxy_test.go at line 596.
What does Test_Proxy_DoRedirects_TooManyRedirects() call?
Test_Proxy_DoRedirects_TooManyRedirects() calls 1 function(s): createRedirectServer.

Analyze Your Own Codebase

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

Try Supermodel Free