diff --git a/src/constants/r2Prefixes.ts b/src/constants/r2Prefixes.ts index ad0a9e7..57e31b6 100644 --- a/src/constants/r2Prefixes.ts +++ b/src/constants/r2Prefixes.ts @@ -3,7 +3,7 @@ // later on. // (e.g. url path `/dist` points to R2 path `nodejs/release`) // See https://raw.githubusercontent.com/nodejs/build/main/ansible/www-standalone/resources/config/nodejs.org -import map from './links.json'; +import map from './redirectLinks.json'; export const REDIRECT_MAP = new Map(map as [string, string][]); diff --git a/src/constants/links.json b/src/constants/redirectLinks.json similarity index 100% rename from src/constants/links.json rename to src/constants/redirectLinks.json diff --git a/tests/e2e/directory.test.ts b/tests/e2e/directory.test.ts index 37ef884..e5ef56a 100644 --- a/tests/e2e/directory.test.ts +++ b/tests/e2e/directory.test.ts @@ -63,34 +63,6 @@ describe('Directory Tests (Restricted Directory Listing)', () => { assert.strictEqual(res.status, 200); }); - it('redirects `/docs` to `/docs/`', async () => { - const originalRes = await mf.dispatchFetch(`${url}docs`, { - redirect: 'manual', - }); - assert.strictEqual(originalRes.status, 301); - const res = await mf.dispatchFetch(originalRes.headers.get('location')!); - assert.strictEqual(res.status, 200); - }); - - it('allows `/docs/`', async () => { - const res = await mf.dispatchFetch(`${url}docs/`); - assert.strictEqual(res.status, 200); - }); - - it('redirects `/api` to `/api/`', async () => { - const originalRes = await mf.dispatchFetch(`${url}api`, { - redirect: 'manual', - }); - assert.strictEqual(originalRes.status, 301); - const res = await mf.dispatchFetch(originalRes.headers.get('location')!); - assert.strictEqual(res.status, 200); - }); - - it('allows `/api/`', async () => { - const res = await mf.dispatchFetch(`${url}api/`); - assert.strictEqual(res.status, 200); - }); - it('redirects `/metrics` to `/metrics/`', async () => { const originalRes = await mf.dispatchFetch(`${url}metrics`, { redirect: 'manual',