rsnext/test/e2e/app-dir/metadata-dynamic-routes
Abhinay Pandey f38dc18861
Fix: generateSitemaps in production giving 404 (#62212)
### What?
generateSitemaps function returns a 404 for /sitemap/[id].xml in
production

### Why?
While finding the correct sitemap partition from the array, we check the
param against the id. Which works in dev because id and param are both
without trailing .xml. But it fails in production as param has a
trailing .xml (/sitemap/[id] works in production because it falls back
to dynamic loading and param and id are both without .xml)

### How?
If we are in production environment, check the id with a trailing .xml
because that's whats returned from generateStaticParams, an array of
__metadata_id__ with trailing .xml

Fixes #61969

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-02-28 12:43:07 +01:00
..
app Fix sitemap generateSitemaps support for string id (#61088) 2024-01-24 16:52:52 +01:00
assets Add test for using custom font in metadata image routes (#54274) 2023-08-19 14:29:18 +00:00
index.test.ts Fix: generateSitemaps in production giving 404 (#62212) 2024-02-28 12:43:07 +01:00
next.config.js Fix trailing slash for canonical url (#62109) 2024-02-15 18:57:15 +01:00