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
505ef11a
Commit
505ef11a
authored
Jan 09, 2026
by
Jiachi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update comment
parent
41fd30ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
utils.ts
packages/next/src/server/web/utils.ts
+5
-2
No files found.
packages/next/src/server/web/utils.ts
View file @
505ef11a
...
@@ -29,8 +29,11 @@ export function fromNodeOutgoingHttpHeaders(
...
@@ -29,8 +29,11 @@ export function fromNodeOutgoingHttpHeaders(
// Try to recover from Mojibake (UTF-8 bytes interpreted as Latin-1)
// Try to recover from Mojibake (UTF-8 bytes interpreted as Latin-1)
v
=
decodeMojibake
(
v
)
v
=
decodeMojibake
(
v
)
// Encode non-ASCII characters to prevent corruption by the Headers API.
// Encode non-ASCII characters for safe HTTP header transport.
// The Headers API in edge runtime doesn't properly preserve Latin-1 characters.
// HTTP headers can be corrupted at multiple points:
// 1. HTTP/2 expects UTF-8; Latin-1 bytes get replaced with replacement chars
// 2. Some runtimes may not preserve non-ASCII in header values
// Percent-encoding ensures safe ASCII-only transmission.
v
=
encodeHeaderValue
(
v
)
v
=
encodeHeaderValue
(
v
)
headers
.
append
(
key
,
v
)
headers
.
append
(
key
,
v
)
...
...
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