@netlify/plugin-nextjs 4.30.4 → 4.30.5-setcookie.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "4.30.4",
3
+ "version": "4.30.5-setcookie.0",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@delucis/if-env": "^1.1.2",
39
- "@netlify/build": "^29.5.4",
39
+ "@netlify/build": "^29.6.0",
40
40
  "@types/fs-extra": "^9.0.13",
41
41
  "@types/jest": "^27.4.1",
42
42
  "@types/merge-stream": "^1.1.2",
@@ -31,12 +31,11 @@ export const addMiddlewareHeaders = async (
31
31
  // We need to await the response to get the origin headers, then we can add the ones from middleware.
32
32
  const res = await originResponse
33
33
  const response = new Response(res.body, res)
34
- const originCookies = response.headers.get('set-cookie')
35
34
  middlewareResponse.headers.forEach((value, key) => {
36
- response.headers.set(key, value)
37
- // Append origin cookies after middleware cookies
38
- if (key === 'set-cookie' && originCookies) {
39
- response.headers.append(key, originCookies)
35
+ if (key === 'set-cookie') {
36
+ response.headers.append(key, value)
37
+ } else {
38
+ response.headers.set(key, value)
40
39
  }
41
40
  })
42
41
  return response