Skip to content

Commit

Permalink
fix: dropped extenal cookie parser to use h3
Browse files Browse the repository at this point in the history
  • Loading branch information
manchenkoff committed May 12, 2024
1 parent 5f0a5f6 commit 1410179
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
},
"dependencies": {
"@nuxt/kit": "^3.9.0",
"@types/set-cookie-parser": "^2.4.7",
"defu": "^6.1.4",
"set-cookie-parser": "^2.6.0"
"defu": "^6.1.4"
},
"devDependencies": {
"@nuxt/devtools": "latest",
Expand All @@ -65,4 +63,4 @@
"vue-tsc": "^1.8.26"
},
"packageManager": "[email protected]"
}
}
10 changes: 3 additions & 7 deletions src/runtime/httpFactory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { $Fetch, FetchOptions } from 'ofetch';
import { appendResponseHeader } from 'h3';
import {
splitCookiesString,
parseString as parseCookieString,
} from 'set-cookie-parser';
import { appendResponseHeader, splitCookiesString } from 'h3';
import {
useCookie,
useRequestEvent,
Expand Down Expand Up @@ -136,8 +132,8 @@ export function createHttpClient(logger: ConsolaInstance): $Fetch {
for (const cookie of cookies) {
appendResponseHeader(event, serverCookieName, cookie);

const metadata = parseCookieString(cookie);
cookieNameList.push(metadata.name);
const cookieName = cookie.split('=')[0];
cookieNameList.push(cookieName);
}

logger.debug(
Expand Down
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2108,15 +2108,6 @@ __metadata:
languageName: node
linkType: hard

"@types/set-cookie-parser@npm:^2.4.7":
version: 2.4.7
resolution: "@types/set-cookie-parser@npm:2.4.7"
dependencies:
"@types/node": "npm:*"
checksum: 10/01ef803e24b8cd33e49fe7463f32a562da45ce3f960381b90cccf67ea71b1830d2273df044255b040069c0a92ea25b4bf21c39ac2f85b50c01818ded5e918554
languageName: node
linkType: hard

"@typescript-eslint/eslint-plugin@npm:^6.5.0":
version: 6.20.0
resolution: "@typescript-eslint/eslint-plugin@npm:6.20.0"
Expand Down Expand Up @@ -6513,7 +6504,6 @@ __metadata:
"@nuxt/schema": "npm:^3.9.0"
"@nuxt/test-utils": "npm:^3.9.0"
"@types/node": "npm:^20.11.13"
"@types/set-cookie-parser": "npm:^2.4.7"
changelogen: "npm:^0.5.5"
defu: "npm:^6.1.4"
eslint: "npm:^8.56.0"
Expand All @@ -6523,7 +6513,6 @@ __metadata:
nuxi: "npm:^3.10.0"
nuxt: "npm:^3.10.0"
prettier: "npm:^3.0.3"
set-cookie-parser: "npm:^2.6.0"
typescript: "npm:^5.2.2"
vite: "npm:^4.4.9"
vitest: "npm:^1.2.2"
Expand Down Expand Up @@ -7851,13 +7840,6 @@ __metadata:
languageName: node
linkType: hard

"set-cookie-parser@npm:^2.6.0":
version: 2.6.0
resolution: "set-cookie-parser@npm:2.6.0"
checksum: 10/8d451ebadb760989f93b634942c79de3c925ca7a986d133d08a80c40b5ae713ce12e354f0d5245c49f288c52daa7bd6554d5dc52f8a4eecaaf5e192881cf2b1f
languageName: node
linkType: hard

"setprototypeof@npm:1.2.0":
version: 1.2.0
resolution: "setprototypeof@npm:1.2.0"
Expand Down

0 comments on commit 1410179

Please sign in to comment.