Home / Function/ Test_Proxy_Do_WithRealURL() — fiber Function Reference

Test_Proxy_Do_WithRealURL() — fiber Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fff43594_d2bd_3c88_8230_7c6a2aa5311d["Test_Proxy_Do_WithRealURL()"]
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2["proxy_test.go"]
  fff43594_d2bd_3c88_8230_7c6a2aa5311d -->|defined in| a7c70172_e40a_6ad6_65b6_b8f508cfb0a2
  52270b9b_26c8_081b_5239_bee723ca512a["createProxyTestServerIPv4()"]
  fff43594_d2bd_3c88_8230_7c6a2aa5311d -->|calls| 52270b9b_26c8_081b_5239_bee723ca512a
  style fff43594_d2bd_3c88_8230_7c6a2aa5311d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 528–550

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

	_, addr := createProxyTestServerIPv4(t, func(c fiber.Ctx) error {
		return c.SendString("real url")
	})

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

	resp, err1 := app.Test(httptest.NewRequest(fiber.MethodGet, "/test", http.NoBody), fiber.TestConfig{
		Timeout:       2 * time.Second,
		FailOnTimeout: true,
	})
	require.NoError(t, err1)
	require.Equal(t, fiber.StatusOK, resp.StatusCode)
	require.Equal(t, "/test", resp.Request.URL.String())
	body, err := io.ReadAll(resp.Body)
	require.NoError(t, err)
	require.Equal(t, "real url", string(body))
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free