@whatwg-node/server-plugin-cookies 0.0.7 → 0.0.8-alpha-20230616101457-f75df5d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/useCookies.js CHANGED
@@ -8,9 +8,10 @@ function useCookies() {
8
8
  request.cookieStore = new cookie_store_1.CookieStore(request.headers.get('cookie') || '');
9
9
  },
10
10
  onResponse({ request, response }) {
11
- var _a;
12
- if ((_a = request.cookieStore) === null || _a === void 0 ? void 0 : _a.cookieString) {
13
- response.headers.set('set-cookie', request.cookieStore.cookieString);
11
+ if (request.cookieStore) {
12
+ for (const cookieString of request.cookieStore.cookieStrings) {
13
+ response.headers.append('set-cookie', cookieString);
14
+ }
14
15
  }
15
16
  },
16
17
  };
package/esm/useCookies.js CHANGED
@@ -5,9 +5,10 @@ export function useCookies() {
5
5
  request.cookieStore = new CookieStore(request.headers.get('cookie') || '');
6
6
  },
7
7
  onResponse({ request, response }) {
8
- var _a;
9
- if ((_a = request.cookieStore) === null || _a === void 0 ? void 0 : _a.cookieString) {
10
- response.headers.set('set-cookie', request.cookieStore.cookieString);
8
+ if (request.cookieStore) {
9
+ for (const cookieString of request.cookieStore.cookieStrings) {
10
+ response.headers.append('set-cookie', cookieString);
11
+ }
11
12
  }
12
13
  },
13
14
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@whatwg-node/server-plugin-cookies",
3
- "version": "0.0.7",
3
+ "version": "0.0.8-alpha-20230616101457-f75df5d",
4
4
  "description": "Cookies Plugin",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@whatwg-node/server": "^0.7.6"
7
+ "@whatwg-node/server": "0.8.11-alpha-20230616101457-f75df5d"
8
8
  },
9
9
  "dependencies": {
10
- "@whatwg-node/cookie-store": "0.1.0",
10
+ "@whatwg-node/cookie-store": "0.1.1-alpha-20230616101457-f75df5d",
11
11
  "tslib": "^2.3.1"
12
12
  },
13
13
  "repository": {