From 9076dc821cf4d0023372ecd4c1d1f4c0f9213afe Mon Sep 17 00:00:00 2001 From: Arsh Date: Mon, 4 Mar 2024 14:56:42 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/render-context.ts | 4 ++-- packages/astro/src/i18n/middleware.ts | 2 +- packages/astro/test/i18n-routing.test.js | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/core/render-context.ts b/packages/astro/src/core/render-context.ts index 1bf5d652a8..fde4509acb 100644 --- a/packages/astro/src/core/render-context.ts +++ b/packages/astro/src/core/render-context.ts @@ -106,8 +106,8 @@ export class RenderContext { // Signal to the i18n middleware to maybe act on this response response.headers.set(ROUTE_TYPE_HEADER, 'page'); // Signal to the error-page-rerouting infra to let this response pass through to avoid loops - if (routeData.route === "/404" || routeData.route === "/500") { - response.headers.set(REROUTE_DIRECTIVE_HEADER, "no") + if (routeData.route === '/404' || routeData.route === '/500') { + response.headers.set(REROUTE_DIRECTIVE_HEADER, 'no'); } return response; } diff --git a/packages/astro/src/i18n/middleware.ts b/packages/astro/src/i18n/middleware.ts index 4affbf9318..e03ba30449 100644 --- a/packages/astro/src/i18n/middleware.ts +++ b/packages/astro/src/i18n/middleware.ts @@ -198,7 +198,7 @@ export function createI18nMiddleware( * To avoid loops and overwriting the contents of `404.astro`, we allow error pages to pass through. */ function notFound(response: Response) { - if (response.headers.get(REROUTE_DIRECTIVE_HEADER) === "no") return response; + if (response.headers.get(REROUTE_DIRECTIVE_HEADER) === 'no') return response; return new Response(null, { status: 404, headers: response.headers, diff --git a/packages/astro/test/i18n-routing.test.js b/packages/astro/test/i18n-routing.test.js index 23255ef9bc..58a609bedb 100644 --- a/packages/astro/test/i18n-routing.test.js +++ b/packages/astro/test/i18n-routing.test.js @@ -1346,7 +1346,6 @@ describe('[SSR] i18n routing', () => { assert.equal((await response.text()).includes('I am index'), true); }); - it('can render the 404.astro route on unmatched requests', async () => { const request = new Request('http://example.com/xyz'); const response = await app.render(request);