diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index 7b556c252..daa79ee6e 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -64,7 +64,9 @@ const { fallback = 'animate' } = Astro.props as Props; }; async function getHTML(href: string) { - const res = await fetch(href); + const res = await fetch(href, { + redirect: 'manual' + }); const html = await res.text(); return { ok: res.ok, html }; } diff --git a/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs b/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs index 02dc2043d..68fdc8e2e 100644 --- a/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs +++ b/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs @@ -7,6 +7,10 @@ export default defineConfig({ output: 'server', adapter: nodejs({ mode: 'standalone' }), integrations: [react()], + redirects: { + '/redirect-two': '/two', + '/redirect-external': 'http://example.com/', + }, vite: { build: { assetsInlineLimit: 0, diff --git a/packages/astro/e2e/fixtures/view-transitions/src/pages/one.astro b/packages/astro/e2e/fixtures/view-transitions/src/pages/one.astro index 3f9666c1d..cc57e76d8 100644 --- a/packages/astro/e2e/fixtures/view-transitions/src/pages/one.astro +++ b/packages/astro/e2e/fixtures/view-transitions/src/pages/one.astro @@ -8,6 +8,8 @@ import Layout from '../components/Layout.astro'; go to 3 go to long page go to top + go to redirect 2 + go to a redirect external