(t *testing.T)
| 412 | } |
| 413 | |
| 414 | func Test_CookieJar_HostOnlyCookieMatchesMixedCaseHost(t *testing.T) { |
| 415 | t.Parallel() |
| 416 | |
| 417 | jar := &CookieJar{} |
| 418 | |
| 419 | origin := fasthttp.AcquireURI() |
| 420 | defer fasthttp.ReleaseURI(origin) |
| 421 | require.NoError(t, origin.Parse(nil, []byte("http://example.com/"))) |
| 422 | |
| 423 | c := &fasthttp.Cookie{} |
| 424 | c.SetKey("sid") |
| 425 | c.SetValue("123") |
| 426 | jar.Set(origin, c) |
| 427 | |
| 428 | mixedCaseHost := fasthttp.AcquireURI() |
| 429 | defer fasthttp.ReleaseURI(mixedCaseHost) |
| 430 | require.NoError(t, mixedCaseHost.Parse(nil, []byte("http://Example.com/"))) |
| 431 | |
| 432 | require.Equal(t, []string{"sid"}, cookieKeys(jar.Get(mixedCaseHost))) |
| 433 | } |
| 434 | |
| 435 | func Test_CookieJar_RejectUnrelatedResponseDomain(t *testing.T) { |
| 436 | t.Parallel() |
nothing calls this directly
no test coverage detected