-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Milestone
Description
Some web framework sometimes uses "quoted-string" as defined in RFC 2965 as a cookie value and it causes web browsers to send a header like Cookie: my_value_a=x; my_value_b="abc:def:xyz";
.
In this case, ctx.cookies.get("my_value_b")
returns "abc:def:xyz"
rather than abc:def:xyz
(no quotes), which is not developer friendly and error-prone when dealing with cookies from other web frameworks.
Since both Django and Express are automatically stripping quotes under the hood (see this PR for details), I think koa should also automatically strip quotes for cookie values.
Possible solutions
- I created a PR for
cookies
npm package, which is used in koa. If this gets accepted, we can just bump up the version ofcookies
npm package. - Otherwise, we might need to "fix" it in koa project.
miwnwski
Metadata
Metadata
Assignees
Labels
No labels