Skip to content

Commit de676eb

Browse files
dylan1951dylan
andauthored
fix: cookie parsing logic (again) (#194)
Co-authored-by: dylan <[email protected]>
1 parent d334286 commit de676eb

File tree

1 file changed

+5
-2
lines changed
  • src/entries/Background

1 file changed

+5
-2
lines changed

src/entries/Background/db.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,11 @@ export async function getCookiesByHost(linkOrHost: string) {
448448
for (const header of filteredRequest.requestHeaders) {
449449
if (header.name.toLowerCase() === 'cookie') {
450450
header.value?.split(';').forEach((cookie) => {
451-
const [name, value] = cookie.split('=');
452-
ret[name.trim()] = value.trim();
451+
const i = cookie.indexOf('=');
452+
if (i !== -1) {
453+
const name = cookie.slice(0, i).trim();
454+
ret[name] = cookie.slice(i + 1).trim();
455+
}
453456
});
454457
}
455458
}

0 commit comments

Comments
 (0)