summaryrefslogtreecommitdiff
path: root/packages/astro/test/ssr-request.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2024-06-10 05:58:44 -0400
committerGravatar GitHub <noreply@github.com> 2024-06-10 10:58:44 +0100
commit97724da93ed7b1db19632c0cdb4b3aab1ff84812 (patch)
treef5305e91d303053146558e63e0ab32a8d254cf35 /packages/astro/test/ssr-request.test.js
parent2da877bfe97144ff5110d011b9bfba270ccfc620 (diff)
downloadastro-97724da93ed7b1db19632c0cdb4b3aab1ff84812.tar.gz
astro-97724da93ed7b1db19632c0cdb4b3aab1ff84812.tar.zst
astro-97724da93ed7b1db19632c0cdb4b3aab1ff84812.zip
Let middleware handle the original request URL (#11211)
* Let middleware handle the original request URL * Add a changeset
Diffstat (limited to '')
-rw-r--r--packages/astro/test/ssr-request.test.js19
1 files changed, 7 insertions, 12 deletions
diff --git a/packages/astro/test/ssr-request.test.js b/packages/astro/test/ssr-request.test.js
index a78a10f25..a520b350c 100644
--- a/packages/astro/test/ssr-request.test.js
+++ b/packages/astro/test/ssr-request.test.js
@@ -43,18 +43,6 @@ describe('Using Astro.request in SSR', () => {
assert.equal($('#origin').text(), 'http://example.com');
});
- it('Duplicate slashes are collapsed', async () => {
- const app = await fixture.loadTestAdapterApp();
- const request = new Request('http://example.com/subpath////request/////');
- const response = await app.render(request);
- assert.equal(response.status, 200);
- const html = await response.text();
- const $ = cheerioLoad(html);
- assert.equal($('#origin').text(), 'http://example.com');
- assert.equal($('#pathname').text(), '/subpath/request/');
- assert.equal($('#request-pathname').text(), '/subpath/request/');
- });
-
it('public file is copied over', async () => {
const json = await fixture.readFile('/client/cars.json');
assert.notEqual(json, undefined);
@@ -107,4 +95,11 @@ describe('Using Astro.request in SSR', () => {
const data = await response.json();
assert.equal(data instanceof Array, true);
});
+
+ it('middleware gets the actual path sent in the request', async () => {
+ const app = await fixture.loadTestAdapterApp();
+ const request = new Request('http://example.com/this//is/my/////directory');
+ const response = await app.render(request);
+ assert.equal(response.status, 301);
+ });
});