MCPcopy
hub / github.com/gin-gonic/gin / TestContextSetCookiePathEmpty

Function TestContextSetCookiePathEmpty

context_test.go:1015–1020  ·  context_test.go::TestContextSetCookiePathEmpty
(t *testing.T)

Source from the content-addressed store, hash-verified

1013}
1014
1015func TestContextSetCookiePathEmpty(t *testing.T) {
1016 c, _ := CreateTestContext(httptest.NewRecorder())
1017 c.SetSameSite(http.SameSiteLaxMode)
1018 c.SetCookie("user", "gin", 1, "", "localhost", true, true)
1019 assert.Equal(t, "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure; SameSite=Lax", c.Writer.Header().Get("Set-Cookie"))
1020}
1021
1022func TestContextGetCookie(t *testing.T) {
1023 c, _ := CreateTestContext(httptest.NewRecorder())

Callers

nothing calls this directly

Calls 5

CreateTestContextFunction · 0.85
SetSameSiteMethod · 0.80
SetCookieMethod · 0.80
GetMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected