Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
20 lines
591 B
Plaintext
20 lines
591 B
Plaintext
export const parseCookies = (headers)=>{
|
|
const list = new Map();
|
|
const rc = headers.get('Cookie');
|
|
if (rc) {
|
|
rc.split(';').forEach((cookie)=>{
|
|
const parts = cookie.split('=');
|
|
const key = parts.shift()?.trim();
|
|
const encodedValue = parts.join('=');
|
|
try {
|
|
const decodedValue = decodeURI(encodedValue);
|
|
list.set(key, decodedValue);
|
|
} catch {
|
|
// ignore invalid encoded values
|
|
}
|
|
});
|
|
}
|
|
return list;
|
|
};
|
|
|
|
//# sourceMappingURL=parseCookies.js.map |