You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does not correctly handle user middleware that redirects to path with canonical locale casing when app enables skipMiddlewareUrlNormalize and path contains locale slug with non-canonical casing #2474
I'm not quite sure exactly what the scope of this is, but the failing tests here have a fixture site that enables skipMiddlewareUrlNormalize and a user middleware that redirects any other casing of /en/* to /en/* (and so on), but when /EN is fetched it redirects to /en/en instead of /en:
● skip-trailing-slash-redirect › should be able to redirect locale casing $1
expect(received).toBe(expected) // Object.is equality
Expected: "/en"
Received: "/en/en"
155 | const res = await next.fetch(`/${locale}`, { redirect: 'manual' })
156 | expect(res.status).toBe(307)
> 157 | expect(new URL(res.headers.get('location'), 'http://n').pathname).toBe(
| ^
158 | `/${locale.toLowerCase()}`
159 | )
160 | }
at toBe (e2e/skip-trailing-slash-redirect/index.test.ts:157:73)
● skip-trailing-slash-redirect › should be able to redirect locale casing $1
expect(received).toBe(expected) // Object.is equality
Expected: "/ja-jp"
Received: "/ja-jp/ja-jp"
155 | const res = await next.fetch(`/${locale}`, { redirect: 'manual' })
156 | expect(res.status).toBe(307)
> 157 | expect(new URL(res.headers.get('location'), 'http://n').pathname).toBe(
| ^
158 | `/${locale.toLowerCase()}`
159 | )
160 | }
at toBe (e2e/skip-trailing-slash-redirect/index.test.ts:157:73)
The following is parsed automatically by the Next.js repo e2e test report generator.
test: test/e2e/skip-trailing-slash-redirect/index.test.ts
reason: does not correctly handle user middleware that redirects to path with canonical locale casing when app enables skipMiddlewareUrlNormalize and path contains locale slug with non-canonical casing