rsnext/test/e2e/app-dir/actions
Zack Tanner 363c2e8eb7
fix server actions behavior on intercepted routes (#59175)
### 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
2023-12-01 14:45:00 -08:00
..
app fix server actions behavior on intercepted routes (#59175) 2023-12-01 14:45:00 -08:00
components fix: server actions initiated from static pages (#51534) 2023-09-14 21:22:19 +00:00
app-action-export.test.ts Remove the experimental serverActions flag (#57145) 2023-10-20 20:45:25 +00:00
app-action-form-state.test.ts Add test case for the permalink option of useFormState (#56329) 2023-10-03 13:47:03 +02:00
app-action-progressive-enhancement.test.ts update status codes for redirect and permanentRedirect in action handlers (#58885) 2023-11-29 08:35:50 +00:00
app-action-size-limit-invalid.test.ts Move serverActionsBodySizeLimit to serverActions.bodySizeLimit (#57433) 2023-10-26 08:51:32 +02:00
app-action.test.ts fix server actions behavior on intercepted routes (#59175) 2023-12-01 14:45:00 -08:00
middleware.js Fix request body hanging when middleware is preset (#57381) 2023-10-25 02:44:10 +00:00
next.config.js Change allowed forwarded hosts to be allowed origins for Server Actions (#58023) 2023-11-08 11:20:32 +01:00