Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Sep 30, 2023
1 parent dc27a19 commit b6ef9c3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion src/constants/r2Prefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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][]);

Expand Down
File renamed without changes.
28 changes: 0 additions & 28 deletions tests/e2e/directory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b6ef9c3

Please sign in to comment.