rsnext/test/e2e/app-dir/app-basepath
Chris Frank 44aeb083cc
Fix internal route redirection with absolute urls outside basePath (#64604)
When performing a redirect() with an absolute path, action-handler
attempts to detect whether the resource is hosted by NextJS. If we
believe it is, we then attempt to stream it.

Previously we were not accounting for basePath which caused absolute
redirects to resources on the same host, but not underneath the
basePath, to be resolved by NextJS. Since the resource is outside the
basePath we resolve a 404 page which returns back as `text/x-component`
and is thus streamed back to the client within the original POST
request.

This PR adds a check for the presence of the basePath within absolute
redirect URLs. This fixes the above problem.

fixes #64413
fixes #64557

---------

Signed-off-by: Chris Frank <chris@cfrank.org>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-18 06:58:38 -07:00
..
app Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00
components test: merge base path tests (#55069) 2023-09-06 17:20:47 +00:00
pages Ensure client filter with basePath is correct (#60580) 2024-01-12 20:55:56 +00:00
index.test.ts Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00
next.config.js Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00