rsnext/test/e2e/app-dir
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
..
_allow-underscored-root-directory Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
actions Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00
actions-allowed-origins Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
actions-navigation fix actions-navigation deploy test (#66850) 2024-06-13 16:57:26 -07:00
actions-revalidate-remount fix 'loading' segment not being copied into new CacheNode (#66538) 2024-06-04 10:15:42 -07:00
app [ppr] Enable static shell debugging in other environments (#65483) 2024-06-10 09:42:32 -07:00
app-a11y Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-alias Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-basepath Fix internal route redirection with absolute urls outside basePath (#64604) 2024-06-18 06:58:38 -07:00
app-basepath-custom-server Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-client-cache fix client-cache deploy tests (#66770) 2024-06-11 22:17:44 +00:00
app-compilation disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
app-config-crossorigin Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-css Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
app-css-pageextensions Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
app-custom-cache-handler [Breaking] Disable automatic fetch caching (#66004) 2024-05-22 19:30:28 -07:00
app-edge Remove process auto polyfill in edge runtime (#65751) 2024-05-15 12:19:47 +02:00
app-edge-root-layout Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-esm-js Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-external feat: remove font family hashing in next/font css (#53608) 2024-05-14 18:22:43 -07:00
app-fetch-deduping remove staticWorkerRequestDeduping flag & unused IPC code (#66655) 2024-06-07 16:42:44 -07:00
app-invalid-revalidate Add missing 'prerenderEarlyExit: false' in tests (#66032) 2024-05-21 07:51:38 -07:00
app-middleware fix middleware cookie initialization (#65820) 2024-05-15 16:54:49 -07:00
app-prefetch fix: app-router prefetch crash when an invalid URL is passed to Link (#66755) 2024-06-11 21:36:27 +02:00
app-prefetch-false Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-prefetch-false-loading fix app-prefetch-false-loading deploy test (#66811) 2024-06-13 00:13:24 +00:00
app-prefetch-static Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-rendering Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-routes fix app-custom-routes deploy test (#66773) 2024-06-11 22:41:37 +00:00
app-routes-client-component fix deploy tests that patch node_modules (#66849) 2024-06-13 23:21:34 +00:00
app-routes-subrequests Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-routes-trailing-slash Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-simple-routes Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
app-static disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
app-validation Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
asset-prefix fix: bundle fetching with asset prefix (#63627) 2024-03-29 16:38:24 -07:00
asset-prefix-with-basepath update turbopack (#64347) 2024-04-11 19:16:27 +02:00
async-component-preload Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
autoscroll-with-css-modules Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
back-button-download-bug Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
binary Re-land Fix broken HTML inlining of non UTF-8 decodable binary data from Flight payload #65664 (#65988) 2024-06-04 20:25:59 -07:00
build-size Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
chunk-loading chore: update prettier to 3.2.5 (#65092) 2024-05-08 21:47:14 +02:00
conflicting-page-segments disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
create-root-layout Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
crypto-globally-available Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
css-client-side-nav-parallel-routes Tweak flakey metadata error tests (#66060) 2024-05-21 21:53:16 -05:00
css-modules-scoping Upgrade lightningcss, disable grid prefixing (#65986) 2024-05-21 19:39:46 +00:00
css-order disable production chunking in dev (#64488) 2024-04-15 21:22:22 +02:00
draft-mode Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
dynamic Revert "Fix esm property def in flight loader" (#66727) 2024-06-11 00:04:33 +00:00
dynamic-css Preload all chunks for next/dynamic in SSR (#65486) 2024-05-08 19:30:42 +02:00
dynamic-data fix: ensure route handlers properly track dynamic access (#66446) 2024-06-01 15:32:50 -07:00
dynamic-href Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
dynamic-in-generate-params Append sitemap extension and optimize imafe metadata static generation (#66477) 2024-06-10 17:34:06 +02:00
dynamic-interception-route-revalidate fix router revalidation behavior for dynamic interception routes (#63768) 2024-03-28 13:35:22 +00:00
dynamic-requests ignore fully dynamic requests on server side (#62949) 2024-03-11 08:41:33 +00:00
ecmascript-features fix(next-swc): Fix SWC env target - include option (#65693) 2024-05-13 16:31:36 +00:00
edge-route-catchall Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
edge-route-rewrite Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
edge-runtime-node-compatibility Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
emotion-js Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
error-boundary-navigation Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
errors Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
fallback-prefetch revert app-render changes related to determining RSC/Prefetch requests (#66648) 2024-06-07 08:50:44 -07:00
front-redirect-issue Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
global-error Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
headers-static-bailout Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
hello-world Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
hooks Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
i18n-hybrid Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
import Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
interception-dynamic-segment Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
interception-dynamic-segment-middleware Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
interception-middleware-rewrite Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
interception-route-prefetch-cache de-flake interception-route-prefetch-cache test (#66854) 2024-06-14 02:52:32 +00:00
interception-routes-root-catchall Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
interoperability-with-pages Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
layout-params Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
loader-file-named-export-custom-loader-error fix: show the error message if images.loaderFile doesn't export a default function (#64036) 2024-04-10 18:11:38 +00:00
logging Append sitemap extension and optimize imafe metadata static generation (#66477) 2024-06-10 17:34:06 +02:00
mdx Bump React types to 19 rc (#66186) 2024-05-27 16:19:41 +00:00
metadata Append sitemap extension and optimize imafe metadata static generation (#66477) 2024-06-10 17:34:06 +02:00
metadata-dynamic-routes Append sitemap extension and optimize imafe metadata static generation (#66477) 2024-06-10 17:34:06 +02:00
metadata-edge Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
metadata-json-manifest Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
metadata-suspense Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
metadata-warnings Warn metadataBase missing in standalone mode or non vercel deployment (#66296) 2024-06-01 20:15:01 +02:00
missing-suspense-with-csr-bailout disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
mjs-as-extension Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
modularizeimports Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
navigation disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
navigation-redirect-import Handle next/navigation import in middleware (#66175) 2024-05-24 15:39:08 +00:00
next-after-app disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
next-after-pages experimental: unstable_after (#65038) 2024-05-20 08:49:53 +00:00
next-config Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
next-dynamic-css fix css order for some edge cases in App Dir (#66500) 2024-06-04 10:18:52 +02:00
next-font feat: remove font family hashing in next/font css (#53608) 2024-05-14 18:22:43 -07:00
next-image disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
not-found Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
not-found-default Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
options-request short-circuit OPTIONS requests to pages (#65295) 2024-05-20 19:58:48 +00:00
pages-to-app-routing Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-route-not-found use correct not-found component when triggered from a parallel route (#65343) 2024-05-06 14:46:54 +00:00
parallel-route-not-found-params fix parallel-route-not-found-params deploy test (#66807) 2024-06-12 20:26:57 +00:00
parallel-routes-and-interception enable parallel-routes-and-interception deploy tests (#66848) 2024-06-13 15:48:47 -07:00
parallel-routes-and-interception-basepath Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-breadcrumbs Fix an issue parsing catchall params (#65277) 2024-05-02 18:31:39 +00:00
parallel-routes-catchall Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-children-slot Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-default Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-dynamic-segment Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-groups Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-slotted-non-catchalls Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
parallel-routes-catchall-specificity fix logic error in parallel route catch-all normalization (#63879) 2024-04-01 08:50:54 -07:00
parallel-routes-css fix missing stylesheets when parallel routes are present (#66300) 2024-06-03 16:35:31 -07:00
parallel-routes-layouts parallel routes: support multi-slot layouts (#61115) 2024-01-26 11:46:23 -08:00
parallel-routes-not-found Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
parallel-routes-revalidation fix parallel-routes-revalidation deploy test (#66831) 2024-06-13 08:57:50 -07:00
parallel-routes-root-slot add explicit test for parallel routes in a root layout (#65338) 2024-05-03 15:05:48 -07:00
parallel-routes-use-selected-layout-segment Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
params-hooks-compat Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
ppr fix ppr deploy test (#66809) 2024-06-12 16:35:55 -07:00
ppr-errors Change default of prerenderEarlyExit to true (#65830) 2024-05-20 12:51:01 -07:00
ppr-full [PPR] Enable incremental adoption (#63847) 2024-05-06 14:55:00 -06:00
ppr-incremental [ppr] Data route fixes (#66109) 2024-05-23 10:24:00 +02:00
ppr-navigations disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
ppr-unstable-cache [unstable_cache] Don't track dynamic fetches in an unstable_cache callback (#65010) 2024-04-26 18:43:42 +00:00
prefetch-searchparam fix(next): initial prefetch cache not set properly with different search params (#65977) 2024-05-20 15:44:03 +00:00
prefetching-not-found fix navigation applying stale data when triggered from global not found (#62033) 2024-02-14 10:46:31 -08:00
resolve-extensions Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
resource-url-encoding Escape url-unsafe characters in names of app router scripts and styles (#64131) 2024-04-10 17:42:53 -07:00
revalidate-dynamic [Breaking] Disable automatic fetch caching (#66004) 2024-05-22 19:30:28 -07:00
rewrites-redirects Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
root-layout Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
root-layout-redirect Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
root-layout-render-once Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
route-page-manifest-bug Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
router-autoscroll Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
router-stuck-dynamic-static-segment Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
rsc-basic test: add name re-export from client components as page case (#66760) 2024-06-11 18:42:10 +00:00
rsc-webpack-loader Split webpack specific test into separate test suite (#66328) 2024-05-30 12:29:18 +02:00
scss fix deploy tests that patch node_modules (#66849) 2024-06-13 23:21:34 +00:00
search-params-react-key Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
searchparams-static-bailout Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
server-actions-relative-redirect Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
server-components-externals disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
set-cookies Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
shallow-routing Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
similar-pages-paths Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
static-generation-status Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
static-shell-debugging [ppr] Improve DX for static shell debugging in dev mode (#66806) 2024-06-14 11:29:11 +00:00
syntax-highlighter-crash Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
tailwind-css fix(turbopack): remove tailwindcss from default external packages (#66706) 2024-06-10 16:23:03 +02:00
taint Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
test-template/{{ toFileName name }} Upgrade lightningcss, disable grid prefixing (#65986) 2024-05-21 19:39:46 +00:00
third-parties Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
trailingslash Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
turbopack-reports Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
typeof-window disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
underscore-ignore-app-paths Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
unstable-rethrow implement unstable_rethrow (#65831) 2024-05-22 07:58:36 -07:00
use-params Fix next/navigation type augmentation (#66489) 2024-06-03 17:53:37 +00:00
use-selected-layout-segment-s Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
webpack-loader-conditions disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
with-babel Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
with-exported-function-config Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
x-forwarded-headers disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00