mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
chore(www): make the launch week 16 rewrite readable (#54476)
Same paths as #54475, with the past launch weeks as named lists instead of one regex. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff9ff456cd
commit
4da4e91a9b
2 files changed
+21
-7
No files matched your search
@@ -13,6 +13,19 @@ const zoneRewrites = (basePath, url) => [
|
||||
{ source: `${basePath}/:path*`, destination: `${url}/:path*` },
|
||||
]
|
||||
|
||||
// Launch Week 16 runs as its own app under /launch-week. The pages of past launch weeks stay on
|
||||
// www, and keep the www security headers
|
||||
const LAUNCH_WEEK_16 = 'https://launch-week-16.vercel.app/launch-week'
|
||||
// these pages stay on www, with everything under them
|
||||
const PAST_LAUNCH_WEEKS = ['6', '7', '8', '12', '13', '14', '15', 'x', 'tickets']
|
||||
// this page stays on www, but not what is under it: the card editor of Launch Week 16 is at
|
||||
// /launch-week/ticket/create/<step>
|
||||
const PAST_LAUNCH_WEEK_PAGES = ['ticket']
|
||||
const notPastLaunchWeek = [
|
||||
...PAST_LAUNCH_WEEKS.map((path) => `${path}(?:/|$)`),
|
||||
...PAST_LAUNCH_WEEK_PAGES.map((path) => `${path}$`),
|
||||
].join('|')
|
||||
|
||||
const rewrites = [
|
||||
{
|
||||
source: '/:path*',
|
||||
@@ -63,17 +76,15 @@ const rewrites = [
|
||||
},
|
||||
// Builder Day: the event site runs as its own Next.js app with basePath '/builderday'
|
||||
...zoneRewrites('/builderday', 'https://builderday.vercel.app/builderday'),
|
||||
// Launch Week 16: the card app runs as its own app with base '/launch-week/'
|
||||
// www removes the trailing slash and the app adds it, so the root targets '/launch-week/'
|
||||
// Launch Week 16. www removes the trailing slash and the app adds it, so the root targets
|
||||
// '/launch-week/'
|
||||
{
|
||||
source: '/launch-week',
|
||||
destination: 'https://launch-week-16.vercel.app/launch-week/',
|
||||
destination: `${LAUNCH_WEEK_16}/`,
|
||||
},
|
||||
// past launch weeks stay on www and keep the www security headers
|
||||
// only the exact /ticket path is the lw15 page. the lw16 editor uses /ticket/create
|
||||
{
|
||||
source: '/launch-week/:path((?!(?:6|7|8|12|13|14|15|x|tickets)(?:/|$)|ticket$).+)',
|
||||
destination: 'https://launch-week-16.vercel.app/launch-week/:path',
|
||||
source: `/launch-week/:path((?!${notPastLaunchWeek}).+)`,
|
||||
destination: `${LAUNCH_WEEK_16}/:path`,
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -257,6 +257,7 @@ describe('getSecurityHeaderRules', () => {
|
||||
'/launch-week/t/someone',
|
||||
'/launch-week/ticket/create/select-material',
|
||||
'/launch-week/16',
|
||||
'/launch-week/ticket/create/decorate',
|
||||
])('does not apply to the proxied path %s', (path) => {
|
||||
expect(headerMatches(wwwRule.source, path)).toBe(false)
|
||||
})
|
||||
@@ -295,7 +296,9 @@ describe('getSecurityHeaderRules', () => {
|
||||
'/launch-week/15',
|
||||
'/launch-week/16',
|
||||
'/launch-week/ticket',
|
||||
'/launch-week/ticket/create/decorate',
|
||||
'/launch-week/tickets/someone',
|
||||
'/launch-week/tickets',
|
||||
'/launch-week/sign-in',
|
||||
'/launch-week/assets/index.js',
|
||||
'/migrate',
|
||||
|
||||
Reference in new issue
Block a user