Home / Function/ Test_Static_Download() — fiber Function Reference

Test_Static_Download() — fiber Function Reference

Architecture documentation for the Test_Static_Download() function in static_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  e93e7a4e_d2dc_120b_c260_236f496d6aa7["Test_Static_Download()"]
  f26a2d79_1e01_f027_82eb_45c4308747e8["static_test.go"]
  e93e7a4e_d2dc_120b_c260_236f496d6aa7 -->|defined in| f26a2d79_1e01_f027_82eb_45c4308747e8
  style e93e7a4e_d2dc_120b_c260_236f496d6aa7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/static/static_test.go lines 207–221

func Test_Static_Download(t *testing.T) {
	t.Parallel()
	app := fiber.New()

	app.Get("/fiber.png", New("../../.github/testdata/fs/img/fiber.png", Config{
		Download: true,
	}))

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/fiber.png", http.NoBody))
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, 200, resp.StatusCode, "Status code")
	require.NotEmpty(t, resp.Header.Get(fiber.HeaderContentLength))
	require.Equal(t, "image/png", resp.Header.Get(fiber.HeaderContentType))
	require.Equal(t, `attachment; filename="fiber.png"`, resp.Header.Get(fiber.HeaderContentDisposition))
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Static_Download() do?
Test_Static_Download() is a function in the fiber codebase, defined in middleware/static/static_test.go.
Where is Test_Static_Download() defined?
Test_Static_Download() is defined in middleware/static/static_test.go at line 207.

Analyze Your Own Codebase

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

Try Supermodel Free