File
Blob: src/workerd/api/tests/opennextjs/src/app/redirect-test/page.jsx
| 1 | // Copyright (c) 2026 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | |
| 5 | import { redirect } from 'next/navigation'; |
| 6 | |
| 7 | export default function RedirectTestPage({ searchParams }) { |
| 8 | return <RedirectHandler searchParams={searchParams} />; |
| 9 | } |
| 10 | |
| 11 | async function RedirectHandler({ searchParams }) { |
| 12 | const params = await searchParams; |
| 13 | if (params.target) { |
| 14 | redirect(params.target); |
| 15 | } |
| 16 | return ( |
| 17 | <main> |
| 18 | <h1>Redirect Test</h1> |
| 19 | <p>Add ?target=/path to redirect</p> |
| 20 | </main> |
| 21 | ); |
| 22 | } |