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
997e3c0c
Unverified
Commit
997e3c0c
authored
Aug 09, 2022
by
JJ Kasper
Committed by
GitHub
Aug 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure locale redirects are not applied in minimal mode (#39436)
parent
ed14af30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
base-server.ts
packages/next/server/base-server.ts
+1
-1
required-server-files-i18n.test.ts
test/production/required-server-files-i18n.test.ts
+21
-0
No files found.
packages/next/server/base-server.ts
View file @
997e3c0c
...
...
@@ -617,7 +617,7 @@ export default abstract class Server<ServerOptions extends Options = Options> {
}
}
if
(
defaultLocale
)
{
if
(
!
this
.
minimalMode
&&
defaultLocale
)
{
const
redirect
=
getLocaleRedirect
({
defaultLocale
,
domainLocale
,
...
...
test/production/required-server-files-i18n.test.ts
View file @
997e3c0c
...
...
@@ -135,6 +135,27 @@ describe('should set-up next', () => {
if
(
server
)
await
killApp
(
server
)
})
it
(
'should not apply locale redirect in minimal mode'
,
async
()
=>
{
const
res
=
await
fetchViaHTTP
(
appPort
,
'/'
,
undefined
,
{
redirect
:
'manual'
,
headers
:
{
'accept-language'
:
'fr'
,
},
})
expect
(
res
.
status
).
toBe
(
200
)
expect
(
await
res
.
text
()).
toContain
(
'index page'
)
const
resCookie
=
await
fetchViaHTTP
(
appPort
,
'/'
,
undefined
,
{
redirect
:
'manual'
,
headers
:
{
'accept-language'
:
'en'
,
cookie
:
'NEXT_LOCALE=fr'
,
},
})
expect
(
resCookie
.
status
).
toBe
(
200
)
expect
(
await
resCookie
.
text
()).
toContain
(
'index page'
)
})
it
(
'should output required-server-files manifest correctly'
,
async
()
=>
{
expect
(
requiredFilesManifest
.
version
).
toBe
(
1
)
expect
(
Array
.
isArray
(
requiredFilesManifest
.
files
)).
toBe
(
true
)
...
...
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