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
2b1c4ad6
Commit
2b1c4ad6
authored
Jan 07, 2026
by
Jiachi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test
parent
1b3b090d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
middleware-non-ascii-headers.test.ts
...re-non-ascii-headers/middleware-non-ascii-headers.test.ts
+8
-16
No files found.
test/e2e/middleware-non-ascii-headers/middleware-non-ascii-headers.test.ts
View file @
2b1c4ad6
...
@@ -46,8 +46,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -46,8 +46,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Montréal'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Montréal'
)
})
})
it
(
'should handle headers with German umlauts (München)'
,
async
()
=>
{
it
(
'should handle headers with German umlauts (München)'
,
async
()
=>
{
...
@@ -64,8 +63,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -64,8 +63,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'München'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'München'
)
})
})
it
(
'should handle headers with Spanish characters (España)'
,
async
()
=>
{
it
(
'should handle headers with Spanish characters (España)'
,
async
()
=>
{
...
@@ -82,8 +80,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -82,8 +80,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'España'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'España'
)
})
})
it
(
'should handle headers with Nordic characters (Malmö, København)'
,
async
()
=>
{
it
(
'should handle headers with Nordic characters (Malmö, København)'
,
async
()
=>
{
...
@@ -101,8 +98,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -101,8 +98,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Malmö'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Malmö'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'København'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'København'
)
})
})
...
@@ -120,8 +116,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -120,8 +116,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'Île-de-France'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'Île-de-France'
)
})
})
it
(
'should handle headers with Austrian characters (Österreich)'
,
async
()
=>
{
it
(
'should handle headers with Austrian characters (Österreich)'
,
async
()
=>
{
...
@@ -138,8 +133,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -138,8 +133,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'Österreich'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'Österreich'
)
})
})
it
(
'should handle multiple headers with various Latin-1 characters'
,
async
()
=>
{
it
(
'should handle multiple headers with various Latin-1 characters'
,
async
()
=>
{
...
@@ -159,8 +153,7 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -159,8 +153,7 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Montréal'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'Montréal'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'Île-de-France'
)
expect
(
headers
[
'x-region'
]).
toBe
(
'Île-de-France'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'Österreich'
)
expect
(
headers
[
'x-country'
]).
toBe
(
'Österreich'
)
expect
(
headers
[
'x-greeting'
]).
toBe
(
'Grüß Gott'
)
expect
(
headers
[
'x-greeting'
]).
toBe
(
'Grüß Gott'
)
...
@@ -180,7 +173,6 @@ describe('Middleware Non-ASCII Headers', () => {
...
@@ -180,7 +173,6 @@ describe('Middleware Non-ASCII Headers', () => {
expect
(
res
.
status
).
toBe
(
200
)
expect
(
res
.
status
).
toBe
(
200
)
const
headers
=
await
res
.
json
()
const
headers
=
await
res
.
json
()
expect
(
headers
[
'x-middleware-ran'
]).
toBe
(
'true'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'São Paulo'
)
expect
(
headers
[
'x-city'
]).
toBe
(
'São Paulo'
)
})
})
})
})
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