From 23094a1f48d0dfb12c5866a3713f52106ef927dd Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 12 Feb 2025 10:34:32 +0000 Subject: fix: use shared helper for file extensions (#13223) * fix: use shared helper for file extensions * Lock --- .../integrations/node/test/trailing-slash.test.js | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'packages/integrations/node/test/trailing-slash.test.js') diff --git a/packages/integrations/node/test/trailing-slash.test.js b/packages/integrations/node/test/trailing-slash.test.js index feed313ce..948f7e0fb 100644 --- a/packages/integrations/node/test/trailing-slash.test.js +++ b/packages/integrations/node/test/trailing-slash.test.js @@ -81,6 +81,17 @@ describe('Trailing slash', () => { assert.equal(res.status, 200); assert.equal(css, 'h1 { color: red; }\n'); }); + + it('Does not redirect requests for static assets with unusual filenames', async () => { + const res = await fetch( + `http://${server.host}:${server.port}/some-base/_astro/bitgeneva12.NY2V_gnX.woff2`, + { + redirect: 'manual', + }, + ); + + assert.equal(res.status, 200); + }); }); describe('Without base', async () => { before(async () => { @@ -143,12 +154,23 @@ describe('Trailing slash', () => { }); it('Does not add trailing slash to subresource urls', async () => { - const res = await fetch(`http://${server.host}:${server.port}/one.css`); + const res = await fetch(`http://${server.host}:${server.port}/one.css`, { redirect: 'manual' }); const css = await res.text(); assert.equal(res.status, 200); assert.equal(css, 'h1 { color: red; }\n'); }); + + it('Does not redirect requests for static assets with unusual filenames', async () => { + const res = await fetch( + `http://${server.host}:${server.port}/_astro/bitgeneva12.NY2V_gnX.woff2`, + { + redirect: 'manual', + }, + ); + + assert.equal(res.status, 200); + }); }); }); describe('Never', async () => { -- cgit v1.2.3