Skip to content
Myr

fix(cookie): get deleted value with prefix (#4133)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jonathan Haines · committed by GitHub · parent 9381d5f · Browse files · 2 files+17 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−3 removed

  • tests:+14 added−0 removed
  • other:+3 added−3 removed

2 files+17 added−3 removed

modified:src/helper/cookie/index.test.ts+14 added
428 unmodified lines
429 const res = await app.request(req)430 expect(res.status).toBe(200)431 expect(await res.text()).toBe('choco')432 })433434 app.get('/delete-cookie-with-prefix', (c) => {435 const deleted = deleteCookie(c, 'delicious_cookie', { prefix: 'secure' })436 return c.text(deleted || '')437 })438439 it('Get deleted value with prefix', async () => {440 const cookieString = '__Secure-delicious_cookie=choco'441 const req = new Request('http://localhost/delete-cookie-with-prefix')442 req.headers.set('Cookie', cookieString)443 const res = await app.request(req)444 expect(res.status).toBe(200)445 expect(await res.text()).toBe('choco')446 })447 })448})
modified:src/helper/cookie/index.ts+3 added-3 removed