File tree 2 files changed +5
-5
lines changed
packages/runtime/src/templates/edge-shared
test/e2e/modified-tests/middleware-redirects/test 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -266,11 +266,11 @@ export const buildResponse = async ({
266
266
res . headers . set ( 'x-nextjs-redirect' , relativizeURL ( redirect , request . url ) )
267
267
}
268
268
269
- // const nextRedirect = res.headers.get('x-nextjs-redirect')
269
+ const nextRedirect = res . headers . get ( 'x-nextjs-redirect' )
270
270
271
- // if (nextRedirect) {
272
- // res.headers.set('x-nextjs-redirect', normalizeDataUrl(nextRedirect))
273
- // }
271
+ if ( nextRedirect && isDataReq ) {
272
+ res . headers . set ( 'x-nextjs-redirect' , normalizeDataUrl ( nextRedirect ) )
273
+ }
274
274
275
275
if ( res . headers . get ( 'x-middleware-next' ) === '1' ) {
276
276
return addMiddlewareHeaders ( context . next ( ) , res )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ describe('Middleware Redirect', () => {
37
37
expect ( res . headers . get ( 'location' ) ?. endsWith ( '/default/about' ) ) . toEqual ( false )
38
38
} )
39
39
40
- usuallySkip ( `should redirect to data urls with data requests and internal redirects` , async ( ) => {
40
+ it ( `should redirect to data urls with data requests and internal redirects` , async ( ) => {
41
41
const res = await fetchViaHTTP (
42
42
next . url ,
43
43
`/_next/data/${ next . buildId } /es/old-home.json` ,
You can’t perform that action at this time.
0 commit comments