rsnext/test
Jiachi Liu dc71a5721b
Fix trailing slash for canonical url (#62109)
### What

We should respect the `trailingSlash` config for metadata canonical url,
this PR is adding the handling for strip or keep the trailing slash for
canonical url. Passing down trailingSlash config to metadata resolving
to decide how we handle it.

### Why

The tricky one was `/` pathname, when visiting the origin directly, that
it will always have at least `/` in the URL instance. But for the
default `origin`, it shouldn't show the `/` if the `trailingSlash`
config is `false`. Also it should show trailing slash for all pathnames
if that config is enabled.

BTW there's a `__NEXT_TRAILING_SLASH` env but since we're using the
fixed nextjs runtime module, so this can't be dynamically replaced in
the metadata resolving modules. So we didn't use it

Fixes #54070 
Closes NEXT-2424
2024-02-15 18:57:15 +01:00
..
.stats-app Reduce memory/cache overhead from over loader processing (#62005) 2024-02-13 22:40:19 +00:00
development Add dev option to Turbopack createProject() (#62083) 2024-02-15 13:50:08 +01:00
e2e Fix trailing slash for canonical url (#62109) 2024-02-15 18:57:15 +01:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration update turbopack (#62080) 2024-02-15 12:41:26 +01:00
lib refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
production refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
unit fix:(next/image) handle remotePatterns with a dot in the pathname (#60488) 2024-02-08 18:21:29 -05:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
build-turbopack-tests-manifest.js test(fixture): fix manifest update (#61970) 2024-02-12 15:26:30 -08:00
get-test-filter.js run tests from test suite that are not listed in the manifest (#58401) 2024-01-11 07:38:35 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Navigation Signals in PPR (#60450) 2024-02-06 12:25:50 -07:00
readme.md
test-file.txt
tsconfig.json chore: extends from shared base tsconfig (#59776) 2023-12-19 18:52:22 +01:00
turbopack-tests-manifest.json fix(next-core): apply image-loader alias to the remaining context (#62070) 2024-02-14 20:21:16 -08:00

See Testing for more information on how you can run/write/debug tests for Next.js.