Skip to content

Commit 4c24e84

Browse files
fix(deps): update dependency cookie to v2 (#2763)
* fix(deps): update dependency cookie to v2 * chore: fix imports --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tobias Bocanegra <tripod@adobe.com>
1 parent ffb4e7f commit 4c24e84

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"chalk-template": "1.1.2",
5454
"chokidar": "5.0.0",
5555
"compression": "1.8.1",
56-
"cookie": "1.1.1",
56+
"cookie": "2.0.1",
5757
"cookie-parser": "1.4.7",
5858
"diff": "9.0.0",
5959
"dotenv": "17.4.2",

src/server/utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import { Socket } from 'net';
1616
import { PassThrough } from 'stream';
1717
import { readFileSync } from 'fs';
1818
import { fileURLToPath } from 'url';
19-
import cookie from 'cookie';
19+
// eslint-disable-next-line import/no-unresolved
20+
import { parseCookie } from 'cookie';
2021
import { unified } from 'unified';
2122
import rehypeParse from 'rehype-parse';
2223
import { select } from 'hast-util-select';
@@ -281,7 +282,7 @@ window.LiveReloadOptions = {
281282

282283
if (!opts.cookies) {
283284
// only pass through hlx-auth-token cookie
284-
const cookies = cookie.parse(headers.cookie || '');
285+
const cookies = parseCookie(headers.cookie || '');
285286
delete headers.cookie;
286287
const hlxAuthToken = cookies['hlx-auth-token'];
287288
if (hlxAuthToken) {

0 commit comments

Comments
 (0)