0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00

fix: typo SameSaite (#159)

* fix: typo

* add test file
This commit is contained in:
Yusuke Wada 2022-04-20 17:57:02 +09:00 committed by GitHub
parent 3e5171fe15
commit a101f8067d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ describe('Cookie Middleware', () => {
app.use('/set-cookie-complex', cookie())
app.get('/set-cookie-complex', (c) => {
c.cookie('greate_cookie', 'banana', {
c.cookie('great_cookie', 'banana', {
path: '/',
secure: true,
domain: 'example.com',
@ -60,7 +60,7 @@ describe('Cookie Middleware', () => {
expect(res.status).toBe(200)
const header = res.headers.get('Set-Cookie')
expect(header).toBe(
'greate_cookie=banana; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSaite=Strict'
'great_cookie=banana; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict'
)
})
})

View File

@ -79,7 +79,7 @@ const serialize = (name: string, value: string, opt: CookieOptions = {}): string
}
if (opt.sameSite) {
cookie += `; SameSaite=${opt.sameSite}`
cookie += `; SameSite=${opt.sameSite}`
}
return cookie