Skip to content

Commit

Permalink
build: upgrade edge-runtime (#67565)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kikobeats and lubieowoce authored Jul 11, 2024
1 parent 04c21cf commit 739361f
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 68 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/preset-flow": "7.22.5",
"@babel/preset-react": "7.22.5",
"@edge-runtime/jest-environment": "2.3.10",
"@edge-runtime/jest-environment": "3.0.0",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.1",
"@fullhuman/postcss-purgecss": "1.3.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@
"@babel/traverse": "7.22.5",
"@babel/types": "7.22.5",
"@capsizecss/metrics": "3.2.0",
"@edge-runtime/cookies": "4.1.1",
"@edge-runtime/ponyfill": "2.4.2",
"@edge-runtime/primitives": "4.1.0",
"@edge-runtime/cookies": "5.0.0",
"@edge-runtime/ponyfill": "3.0.0",
"@edge-runtime/primitives": "5.0.0",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down Expand Up @@ -238,7 +238,7 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.5.4",
"edge-runtime": "3.0.0",
"events": "3.3.0",
"find-up": "4.1.0",
"fresh": "0.5.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/cookies","version":"4.1.1","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/cookies","version":"5.0.0","main":"./index.js","license":"MIT"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/ponyfill","version":"2.4.2","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}
{"name":"@edge-runtime/ponyfill","version":"3.0.0","main":"./index.js","types":"./index.d.ts","license":"MIT"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/primitives","version":"4.1.0","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/primitives","version":"5.0.0","main":"./index.js","license":"MIT"}
2 changes: 1 addition & 1 deletion packages/next/src/compiled/edge-runtime/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/src/compiled/edge-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"edge-runtime","main":"index.js","license":"MPL-2.0"}
{"name":"edge-runtime","main":"index.js","license":"MIT"}
16 changes: 10 additions & 6 deletions packages/next/src/server/next-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1623,16 +1623,20 @@ export default class NextNodeServer extends BaseServer<
return { finished: true }
}

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

// Clear existing header.
result.response.headers.delete(key)
// Clear existing header(s)
result.response.headers.delete('set-cookie')

// Append each cookie individually.
const cookies = splitCookiesString(value)
for (const cookie of cookies) {
result.response.headers.append(key, cookie)
result.response.headers.append('set-cookie', cookie)
}

// Add cookies to request meta.
Expand Down
93 changes: 42 additions & 51 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/e2e/middleware-general/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ describe('Middleware Runtime', () => {
const payload = readMiddlewareJSON(response)
expect('error' in payload).toBe(true)
expect(payload.error.name).toBe('AbortError')
expect(payload.error.message).toContain('The operation was aborted')
expect(payload.error.message).toContain('This operation was aborted')
})

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

0 comments on commit 739361f

Please sign in to comment.