Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Mar 4, 2024
1 parent 9deb919 commit 9076dc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/core/render-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/i18n/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/i18n-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9076dc8

Please sign in to comment.