summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <lilnasy@users.noreply.github.com> 2024-03-04 14:56:42 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2024-03-04 14:56:42 +0000
commit9076dc821cf4d0023372ecd4c1d1f4c0f9213afe (patch)
tree67c3884fd0d5d2309cb0057d46bcba72faae5812
parent9deb919ff95b1d2ffe5a5f70ec683e32ebfafd05 (diff)
downloadastro-9076dc821cf4d0023372ecd4c1d1f4c0f9213afe.tar.gz
astro-9076dc821cf4d0023372ecd4c1d1f4c0f9213afe.tar.zst
astro-9076dc821cf4d0023372ecd4c1d1f4c0f9213afe.zip
[ci] format
-rw-r--r--packages/astro/src/core/render-context.ts4
-rw-r--r--packages/astro/src/i18n/middleware.ts2
-rw-r--r--packages/astro/test/i18n-routing.test.js1
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 1bf5d652a..fde4509ac 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 4affbf931..e03ba3044 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 23255ef9b..58a609bed 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);