Home / Function/ Test_Proxy_Immutable() — fiber Function Reference

Test_Proxy_Immutable() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 882–905

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

	target, addr := createProxyTestServerIPv4(t, func(c fiber.Ctx) error {
		return c.SendStatus(fiber.StatusTeapot)
	})

	resp, err := target.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody), fiber.TestConfig{
		Timeout:       2 * time.Second,
		FailOnTimeout: true,
	})
	require.NoError(t, err)
	require.Equal(t, fiber.StatusTeapot, resp.StatusCode)

	app := fiber.New(fiber.Config{Immutable: true})

	app.Use(Balancer(Config{Servers: []string{addr}}))

	req := httptest.NewRequest(fiber.MethodGet, "/", http.NoBody)
	req.Host = addr
	resp, err = app.Test(req)
	require.NoError(t, err)
	require.Equal(t, fiber.StatusTeapot, resp.StatusCode)
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Proxy_Immutable() do?
Test_Proxy_Immutable() is a function in the fiber codebase, defined in middleware/proxy/proxy_test.go.
Where is Test_Proxy_Immutable() defined?
Test_Proxy_Immutable() is defined in middleware/proxy/proxy_test.go at line 882.
What does Test_Proxy_Immutable() call?
Test_Proxy_Immutable() 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