We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
=
1 parent 3a9b032 commit 83ff31bCopy full SHA for 83ff31b
src/node/server.ts
@@ -440,8 +440,11 @@ export abstract class Server {
440
const cookies: { [key: string]: string } = {};
441
if (request.headers.cookie) {
442
request.headers.cookie.split(";").forEach((keyValue) => {
443
- const [key, value] = keyValue.split("=", 2);
444
- cookies[key.trim()] = decodeURI(value);
+ // key=value -> { [key]: value } and key -> { [key]: "" }
+ const index = keyValue.indexOf("=");
445
+ const key = keyValue.substring(0, index).trim();
446
+ const value = keyValue.substring(index + 1);
447
+ cookies[key || value] = decodeURI(key ? value : "");
448
});
449
}
450
return cookies as T;
0 commit comments