Skip to content

Commit bce2ec0

Browse files
Kikobeatslubieowoce
authored andcommittedAug 26, 2024
build: upgrade edge-runtime (#67565)
The only change in this new version is that the project is now licensed under the MIT license. --------- Co-authored-by: Janka Uryga <lolzatu2@gmail.com>

File tree

10 files changed

+61
-65
lines changed

10 files changed

+61
-65
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
6969
"@babel/preset-flow": "7.22.5",
7070
"@babel/preset-react": "7.22.5",
71-
"@edge-runtime/jest-environment": "2.3.10",
71+
"@edge-runtime/jest-environment": "3.0.0",
7272
"@emotion/cache": "11.11.0",
7373
"@emotion/react": "11.11.1",
7474
"@fullhuman/postcss-purgecss": "1.3.0",

‎packages/next/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@
141141
"@babel/traverse": "7.22.5",
142142
"@babel/types": "7.22.5",
143143
"@capsizecss/metrics": "2.2.0",
144-
"@edge-runtime/cookies": "4.1.1",
145-
"@edge-runtime/ponyfill": "2.4.2",
146-
"@edge-runtime/primitives": "4.1.0",
144+
"@edge-runtime/cookies": "5.0.0",
145+
"@edge-runtime/ponyfill": "3.0.0",
146+
"@edge-runtime/primitives": "5.0.0",
147147
"@hapi/accept": "5.0.2",
148148
"@jest/transform": "29.5.0",
149149
"@jest/types": "29.5.0",
@@ -229,7 +229,7 @@
229229
"debug": "4.1.1",
230230
"devalue": "2.0.1",
231231
"domain-browser": "4.19.0",
232-
"edge-runtime": "2.5.4",
232+
"edge-runtime": "3.0.0",
233233
"events": "3.3.0",
234234
"find-up": "4.1.0",
235235
"fresh": "0.5.2",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"@edge-runtime/cookies","version":"4.1.1","main":"./index.js","license":"MPL-2.0"}
1+
{"name":"@edge-runtime/cookies","version":"5.0.0","main":"./index.js","license":"MIT"}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"@edge-runtime/ponyfill","version":"2.4.2","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}
1+
{"name":"@edge-runtime/ponyfill","version":"3.0.0","main":"./index.js","types":"./index.d.ts","license":"MIT"}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"@edge-runtime/primitives","version":"4.1.0","main":"./index.js","license":"MPL-2.0"}
1+
{"name":"@edge-runtime/primitives","version":"5.0.0","main":"./index.js","license":"MIT"}

‎packages/next/src/compiled/edge-runtime/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"edge-runtime","main":"index.js","license":"MPL-2.0"}
1+
{"name":"edge-runtime","main":"index.js","license":"MIT"}

‎packages/next/src/server/next-server.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -1619,16 +1619,20 @@ export default class NextNodeServer extends BaseServer {
16191619
return { finished: true }
16201620
}
16211621

1622-
for (let [key, value] of result.response.headers) {
1623-
if (key.toLowerCase() !== 'set-cookie') continue
1622+
// Split compound (comma-separated) set-cookie headers
1623+
if (result.response.headers.has('set-cookie')) {
1624+
const cookies = result.response.headers
1625+
.getSetCookie()
1626+
.flatMap((maybeCompoundCookie) =>
1627+
splitCookiesString(maybeCompoundCookie)
1628+
)
16241629

1625-
// Clear existing header.
1626-
result.response.headers.delete(key)
1630+
// Clear existing header(s)
1631+
result.response.headers.delete('set-cookie')
16271632

16281633
// Append each cookie individually.
1629-
const cookies = splitCookiesString(value)
16301634
for (const cookie of cookies) {
1631-
result.response.headers.append(key, cookie)
1635+
result.response.headers.append('set-cookie', cookie)
16321636
}
16331637

16341638
// Add cookies to request meta.

‎pnpm-lock.yaml

+40-48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/e2e/middleware-general/test/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ describe('Middleware Runtime', () => {
559559
const payload = readMiddlewareJSON(response)
560560
expect('error' in payload).toBe(true)
561561
expect(payload.error.name).toBe('AbortError')
562-
expect(payload.error.message).toContain('The operation was aborted')
562+
expect(payload.error.message).toContain('This operation was aborted')
563563
})
564564

565565
it(`should validate & parse request url from any route`, async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.