363c2e8eb7
### What? When using a server action on an intercepted route, when submitting that action, you'd expect it to correspond with the page you're currently on. However if you have route interception set up, and you load the page rather than the intercepted page, submitting the action would `POST` to the intercepted page. This would result in a 404 error because the action ID you're attempting to submit wouldn't be found on the requested page. ### Why? Interception routes rely on the `Next-Url` request header to determine if an interception should occur via a rewrite. However, server actions are submitted with this header as well, so the rewrite will be applied to the `POST` request corresponding with a non-existent action, or an action on the intercepted page. ### How? When loading a page that has an intercepted route, `nextUrl` should be consistent with URL derived from the flight router state tree. But when an interception occurs via navigation, `nextUrl` will now deviate. I'm using this to determine whether or not `Next-Url` should be forwarded along in the `POST` request. Closes NEXT-1436 Fixes #52591 Fixes #49934 |
||
---|---|---|
.. | ||
.stats-app | ||
development | ||
e2e | ||
examples | ||
integration | ||
lib | ||
production | ||
unit | ||
.gitignore | ||
build-turbopack-tests-manifest.d.ts | ||
build-turbopack-tests-manifest.js | ||
get-test-filter.js | ||
jest-setup-after-env.ts | ||
ppr-tests-manifest.json | ||
readme.md | ||
test-file.txt | ||
turbopack-tests-manifest.json |