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
In middleware we intercept redirects inside data requests (i.e. those in /_next/data/..) and set the x-next-redirect header instead. This is because the router handles the redirect instead. However we're currently not normalizing the redirect target. The correct behaviour should be to always set it to the normalized path, even if the target is for the data URL. e.g. a redirect to /_next/data/build-id/en-gb/hello.json?foo=bar should be normalized to /en-gb/hello?foo=bar. Next.js implements this here
e2e test: middleware-redirects
The text was updated successfully, but these errors were encountered:
In middleware we intercept redirects inside data requests (i.e. those in
/_next/data/..
) and set thex-next-redirect
header instead. This is because the router handles the redirect instead. However we're currently not normalizing the redirect target. The correct behaviour should be to always set it to the normalized path, even if the target is for the data URL. e.g. a redirect to/_next/data/build-id/en-gb/hello.json?foo=bar
should be normalized to/en-gb/hello?foo=bar
. Next.js implements this heree2e test:
middleware-redirects
The text was updated successfully, but these errors were encountered: