Home / Function/ Test_CSRF_FromContextMethods_Invalid() — fiber Function Reference

Test_CSRF_FromContextMethods_Invalid() — fiber Function Reference

Architecture documentation for the Test_CSRF_FromContextMethods_Invalid() function in csrf_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  d594810c_76b5_d611_a0f7_269e85f53d03["Test_CSRF_FromContextMethods_Invalid()"]
  306a0c68_f5a5_b368_f37a_1419425a8fea["csrf_test.go"]
  d594810c_76b5_d611_a0f7_269e85f53d03 -->|defined in| 306a0c68_f5a5_b368_f37a_1419425a8fea
  style d594810c_76b5_d611_a0f7_269e85f53d03 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/csrf/csrf_test.go lines 2017–2034

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

	app.Get("/", func(c fiber.Ctx) error {
		token := TokenFromContext(c)
		require.Empty(t, token)

		handler := HandlerFromContext(c)
		require.Nil(t, handler)

		return c.SendStatus(fiber.StatusOK)
	})

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

Subdomains

Frequently Asked Questions

What does Test_CSRF_FromContextMethods_Invalid() do?
Test_CSRF_FromContextMethods_Invalid() is a function in the fiber codebase, defined in middleware/csrf/csrf_test.go.
Where is Test_CSRF_FromContextMethods_Invalid() defined?
Test_CSRF_FromContextMethods_Invalid() is defined in middleware/csrf/csrf_test.go at line 2017.

Analyze Your Own Codebase

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

Try Supermodel Free