Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
7db2ce3b
Unverified
Commit
7db2ce3b
authored
Oct 18, 2023
by
Jiachi Liu
Committed by
GitHub
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade edge-runtime/cookies (#57021)
parent
40965ebd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
10 deletions
+63
-10
package.json
packages/next/package.json
+1
-1
index.js
packages/next/src/compiled/@edge-runtime/cookies/index.js
+54
-1
package.json
...ages/next/src/compiled/@edge-runtime/cookies/package.json
+1
-1
pnpm-lock.yaml
pnpm-lock.yaml
+7
-7
No files found.
packages/next/package.json
View file @
7db2ce3b
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
"@babel/traverse"
:
"7.18.0"
,
"@babel/traverse"
:
"7.18.0"
,
"@babel/types"
:
"7.18.0"
,
"@babel/types"
:
"7.18.0"
,
"@capsizecss/metrics"
:
"1.1.0"
,
"@capsizecss/metrics"
:
"1.1.0"
,
"@edge-runtime/cookies"
:
"4.0.
1
"
,
"@edge-runtime/cookies"
:
"4.0.
2
"
,
"@edge-runtime/ponyfill"
:
"2.4.1"
,
"@edge-runtime/ponyfill"
:
"2.4.1"
,
"@edge-runtime/primitives"
:
"4.0.2"
,
"@edge-runtime/primitives"
:
"4.0.2"
,
"@hapi/accept"
:
"5.0.2"
,
"@hapi/accept"
:
"5.0.2"
,
...
...
packages/next/src/compiled/@edge-runtime/cookies/index.js
View file @
7db2ce3b
...
@@ -111,6 +111,57 @@ function parsePriority(string) {
...
@@ -111,6 +111,57 @@ function parsePriority(string) {
string
=
string
.
toLowerCase
();
string
=
string
.
toLowerCase
();
return
PRIORITY
.
includes
(
string
)
?
string
:
void
0
;
return
PRIORITY
.
includes
(
string
)
?
string
:
void
0
;
}
}
function
splitCookiesString
(
cookiesString
)
{
if
(
!
cookiesString
)
return
[];
var
cookiesStrings
=
[];
var
pos
=
0
;
var
start
;
var
ch
;
var
lastComma
;
var
nextStart
;
var
cookiesSeparatorFound
;
function
skipWhitespace
()
{
while
(
pos
<
cookiesString
.
length
&&
/
\s
/
.
test
(
cookiesString
.
charAt
(
pos
)))
{
pos
+=
1
;
}
return
pos
<
cookiesString
.
length
;
}
function
notSpecialChar
()
{
ch
=
cookiesString
.
charAt
(
pos
);
return
ch
!==
"="
&&
ch
!==
";"
&&
ch
!==
","
;
}
while
(
pos
<
cookiesString
.
length
)
{
start
=
pos
;
cookiesSeparatorFound
=
false
;
while
(
skipWhitespace
())
{
ch
=
cookiesString
.
charAt
(
pos
);
if
(
ch
===
","
)
{
lastComma
=
pos
;
pos
+=
1
;
skipWhitespace
();
nextStart
=
pos
;
while
(
pos
<
cookiesString
.
length
&&
notSpecialChar
())
{
pos
+=
1
;
}
if
(
pos
<
cookiesString
.
length
&&
cookiesString
.
charAt
(
pos
)
===
"="
)
{
cookiesSeparatorFound
=
true
;
pos
=
nextStart
;
cookiesStrings
.
push
(
cookiesString
.
substring
(
start
,
lastComma
));
start
=
pos
;
}
else
{
pos
=
lastComma
+
1
;
}
}
else
{
pos
+=
1
;
}
}
if
(
!
cookiesSeparatorFound
||
pos
>=
cookiesString
.
length
)
{
cookiesStrings
.
push
(
cookiesString
.
substring
(
start
,
cookiesString
.
length
));
}
}
return
cookiesStrings
;
}
// src/request-cookies.ts
// src/request-cookies.ts
var
RequestCookies
=
class
{
var
RequestCookies
=
class
{
...
@@ -196,8 +247,10 @@ var ResponseCookies = class {
...
@@ -196,8 +247,10 @@ var ResponseCookies = class {
constructor
(
responseHeaders
)
{
constructor
(
responseHeaders
)
{
/** @internal */
/** @internal */
this
.
_parsed
=
/* @__PURE__ */
new
Map
();
this
.
_parsed
=
/* @__PURE__ */
new
Map
();
var
_a
,
_b
,
_c
;
this
.
_headers
=
responseHeaders
;
this
.
_headers
=
responseHeaders
;
const
cookieStrings
=
responseHeaders
.
getSetCookie
();
const
setCookie
=
(
_c
=
(
_b
=
(
_a
=
responseHeaders
.
getSetCookie
)
==
null
?
void
0
:
_a
.
call
(
responseHeaders
))
!=
null
?
_b
:
responseHeaders
.
get
(
"set-cookie"
))
!=
null
?
_c
:
[];
const
cookieStrings
=
Array
.
isArray
(
setCookie
)
?
setCookie
:
splitCookiesString
(
setCookie
);
for
(
const
cookieString
of
cookieStrings
)
{
for
(
const
cookieString
of
cookieStrings
)
{
const
parsed
=
parseSetCookie
(
cookieString
);
const
parsed
=
parseSetCookie
(
cookieString
);
if
(
parsed
)
if
(
parsed
)
...
...
packages/next/src/compiled/@edge-runtime/cookies/package.json
View file @
7db2ce3b
{
"name"
:
"@edge-runtime/cookies"
,
"version"
:
"4.0.
1
"
,
"main"
:
"./index.js"
,
"license"
:
"MPL-2.0"
}
{
"name"
:
"@edge-runtime/cookies"
,
"version"
:
"4.0.
2
"
,
"main"
:
"./index.js"
,
"license"
:
"MPL-2.0"
}
pnpm-lock.yaml
View file @
7db2ce3b
...
@@ -893,8 +893,8 @@ importers:
...
@@ -893,8 +893,8 @@ importers:
specifier
:
1.1.0
specifier
:
1.1.0
version
:
1.1.0
version
:
1.1.0
'
@edge-runtime/cookies'
:
'
@edge-runtime/cookies'
:
specifier
:
4.0.
1
specifier
:
4.0.
2
version
:
4.0.
1
version
:
4.0.
2
'
@edge-runtime/ponyfill'
:
'
@edge-runtime/ponyfill'
:
specifier
:
2.4.1
specifier
:
2.4.1
version
:
2.4.1
version
:
2.4.1
...
@@ -5045,8 +5045,8 @@ packages:
...
@@ -5045,8 +5045,8 @@ packages:
resolution
:
{
integrity
:
sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew==
}
resolution
:
{
integrity
:
sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew==
}
dev
:
true
dev
:
true
/@edge-runtime/cookies@4.0.
1
:
/@edge-runtime/cookies@4.0.
2
:
resolution
:
{
integrity
:
sha512-
QIZ1lz6rAF8rTrFdGkljedUaZpXbGIWmRdbA+kwm15ddFfryyekYwI3luFKB33KDcXRHrBi6WdMuyQN19CS6pg
==
}
resolution
:
{
integrity
:
sha512-
BphVamVz/yt9FN1b60ZXp+iTJVRLUHI0POxKYZG3gn+RsP+M0phqS87Z9JnDn2YOsPx9SRhhrN9AB7yhpexNEw
==
}
engines
:
{
node
:
'
>=16'
}
engines
:
{
node
:
'
>=16'
}
dev
:
true
dev
:
true
...
@@ -6723,8 +6723,8 @@ packages:
...
@@ -6723,8 +6723,8 @@ packages:
resolution
:
{
integrity
:
sha512-XQr74QaLeMiqhStEhLn1im9EOMnkypp7MZOwQhGzqp2Weu5eQJbpPxWxixxlYRKWPOmJjsk6qYfYH9kq43yc2w==
}
resolution
:
{
integrity
:
sha512-XQr74QaLeMiqhStEhLn1im9EOMnkypp7MZOwQhGzqp2Weu5eQJbpPxWxixxlYRKWPOmJjsk6qYfYH9kq43yc2w==
}
dev
:
true
dev
:
true
/@next/react-refresh-utils@13.5.
4
(react-refresh@0.12.0)(webpack@5.86.0)
:
/@next/react-refresh-utils@13.5.
5
(react-refresh@0.12.0)(webpack@5.86.0)
:
resolution
:
{
integrity
:
sha512-
Y2bFd17Gn5Wh1gT/P/xTlApmipdrD0JdTdMwhi8G2wD2qj8p7SZbci1kp7zp+utWVp8PFQD6kHAIBrJS9/iEQQ
==
}
resolution
:
{
integrity
:
sha512-
8lvKW22vbWnloufUverqDOsmesoqBPxnX2rUAZuZ+e7240BqvXvhuWd9XWbwFXZ7bgR1FWU/5NYpGK/b2rT5vw
==
}
peerDependencies
:
peerDependencies
:
react-refresh
:
0.12.0
react-refresh
:
0.12.0
webpack
:
5.86.0
webpack
:
5.86.0
...
@@ -26794,7 +26794,7 @@ packages:
...
@@ -26794,7 +26794,7 @@ packages:
name
:
'
@vercel/turbopack-ecmascript-runtime'
name
:
'
@vercel/turbopack-ecmascript-runtime'
version
:
0.0.0
version
:
0.0.0
dependencies
:
dependencies
:
'
@next/react-refresh-utils'
:
13.5.
4
(react-refresh@0.12.0)(webpack@5.86.0)
'
@next/react-refresh-utils'
:
13.5.
5
(react-refresh@0.12.0)(webpack@5.86.0)
'
@types/node'
:
20.2.5
'
@types/node'
:
20.2.5
transitivePeerDependencies
:
transitivePeerDependencies
:
-
react-refresh
-
react-refresh
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment