Skip to content

Commit

Permalink
feat: check if response is finished
Browse files Browse the repository at this point in the history
Chore/added cheking if response is finished
  • Loading branch information
maticzav committed May 6, 2020
2 parents 30c3d7d + b1b4053 commit 2b1e33d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -137,7 +137,9 @@ export function setCookie(
})

cookiesToSet.push(cookie.serialize(name, value, options))
ctx.res.setHeader('Set-Cookie', cookiesToSet)
if (!ctx.res.finished) {
ctx.res.setHeader('Set-Cookie', cookiesToSet)
}
}

if (isBrowser()) {
Expand Down

0 comments on commit 2b1e33d

Please sign in to comment.