Home / Function/ Test_hasFlashCookieExactMatch() — fiber Function Reference

Test_hasFlashCookieExactMatch() — fiber Function Reference

Architecture documentation for the Test_hasFlashCookieExactMatch() function in router_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  3ff757c5_1173_14f3_2ccc_8038851b339d["Test_hasFlashCookieExactMatch()"]
  326d7e00_9e4f_d854_0c78_b9c0c93e5537["router_test.go"]
  3ff757c5_1173_14f3_2ccc_8038851b339d -->|defined in| 326d7e00_9e4f_d854_0c78_b9c0c93e5537
  style 3ff757c5_1173_14f3_2ccc_8038851b339d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

router_test.go lines 73–96

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

	buildRequestWithCookie := func(t *testing.T, cookie string) *fasthttp.Request {
		t.Helper()

		rawRequest := strings.NewReader(
			"GET / HTTP/1.1\r\nHost: localhost\r\nCookie: " + cookie + "\r\n\r\n",
		)
		req := new(fasthttp.Request)
		require.NoError(t, req.Read(bufio.NewReader(rawRequest)))
		return req
	}

	req := buildRequestWithCookie(t, FlashCookieName+"X=not-the-flash-cookie")
	require.False(t, hasFlashCookie(&req.Header))

	req = buildRequestWithCookie(t, FlashCookieName+"=valid")
	require.True(t, hasFlashCookie(&req.Header))

	var syntheticReq fasthttp.Request
	syntheticReq.Header.Set(HeaderCookie, FlashCookieName+"=valid")
	require.False(t, hasFlashCookie(&syntheticReq.Header))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_hasFlashCookieExactMatch() do?
Test_hasFlashCookieExactMatch() is a function in the fiber codebase, defined in router_test.go.
Where is Test_hasFlashCookieExactMatch() defined?
Test_hasFlashCookieExactMatch() is defined in router_test.go at line 73.

Analyze Your Own Codebase

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

Try Supermodel Free