rsnext/test/lib
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
..
browsers Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00
next-modes fix ppr deploy test (#66809) 2024-06-12 16:35:55 -07:00
test-data-service [PPR Nav] Fix flash of loading state during back/forward (#60578) 2024-01-12 14:18:54 -05:00
amp-readme.md Use local AMP validator to reduce test flakiness (#63838) 2024-03-28 20:25:35 +00:00
amp-test-utils.js Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
amp-validator-wasm.js Use local AMP validator to reduce test flakiness (#63838) 2024-03-28 20:25:35 +00:00
create-next-install.js Fix swc test path from node_modules (#66047) 2024-05-21 11:01:35 -07:00
development-sandbox.ts fix dev overlay pseudo html collapsing (#62728) 2024-03-01 19:13:57 +01:00
e2e-utils.ts fix isTurbopack check in test cases (#65446) 2024-05-07 17:38:57 +02:00
next-test-utils.ts Add support for IPv6 in tests (#66285) 2024-05-28 13:14:27 -07:00
next-webdriver.ts refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
react-channel-require-hook.js Preload css (#48840) 2023-04-27 12:51:52 +02:00
test-log.ts [PPR Nav] Fix flash of loading state during back/forward (#60578) 2024-01-12 14:18:54 -05:00
turbo.ts remove --turbo, use --experimental-turbo as --turbo (#55063) 2023-09-06 17:46:54 +00:00
use-temp-dir.ts fix(cli): handle Tailwind CSS + src/ correctly (#47238) 2023-03-20 14:21:29 -07:00