rsnext/test/e2e/app-dir/navigation
Shohei Maeda efd8d22654
Add new permanentRedirect function in App Router (#54047)
for internal:
https://vercel.slack.com/archives/C03S8ED1DKM/p1691700057242999

### Problem

- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
can't control the status code.
- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
returns a 307 HTTP redirect response while it returns a 308-equivalent
meta tag `<meta http-equiv="refresh" content="0;url=/foo"/>` in
streaming response (e.g., suspense boundary), making the behavior
inconsistent.

### Solution

Adding a new `permanentRedirect()` function and changing the meta tag
default accordingly.

| func   |      HTTP status      |  meta tag |
|---|:---:|---|
| `redirect()` | 307 | `<meta http-equiv="refresh"
content="1;url=/foo"/>` |
| `permanentRedirect()` | 308 | `<meta http-equiv="refresh"
content="0;url=/foo"/>` |

ref.
https://developers.google.com/search/docs/crawling-indexing/301-redirects

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-28 14:22:43 -07:00
..
app Add new permanentRedirect function in App Router (#54047) 2023-08-28 14:22:43 -07:00
pages Strip _rsc query for navigation between app and page (#51195) 2023-06-12 20:36:36 +00:00
middleware.js Add unique search query for RSC requests to be cacable on CDN (#50970) 2023-06-12 11:52:36 +02:00
navigation.test.ts Add new permanentRedirect function in App Router (#54047) 2023-08-28 14:22:43 -07:00
next.config.js Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00