summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <lilnasy@users.noreply.github.com> 2024-01-23 14:04:53 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2024-01-23 14:04:53 +0000
commit17f27e7cebe612ba38fcee09e35df0a8e0ce86cd (patch)
treee420925100cd1c4386069dfd6d810845b08aadd8
parent075706f26d2e11e66ef8b52288d07e3c0fa97eb1 (diff)
downloadastro-17f27e7cebe612ba38fcee09e35df0a8e0ce86cd.tar.gz
astro-17f27e7cebe612ba38fcee09e35df0a8e0ce86cd.tar.zst
astro-17f27e7cebe612ba38fcee09e35df0a8e0ce86cd.zip
[ci] format
-rw-r--r--packages/astro/src/core/app/index.ts11
-rw-r--r--packages/astro/src/core/pipeline.ts8
-rw-r--r--packages/astro/src/runtime/server/endpoint.ts2
3 files changed, 9 insertions, 12 deletions
diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts
index f4a7a249e..6189b00f8 100644
--- a/packages/astro/src/core/app/index.ts
+++ b/packages/astro/src/core/app/index.ts
@@ -276,15 +276,18 @@ export class App {
return this.#renderError(request, { status: 500 });
}
- if (REROUTABLE_STATUS_CODES.has(response.status) && response.headers.get("X-Astro-Reroute") !== "no") {
+ if (
+ REROUTABLE_STATUS_CODES.has(response.status) &&
+ response.headers.get('X-Astro-Reroute') !== 'no'
+ ) {
return this.#renderError(request, {
response,
status: response.status as 404 | 500,
});
}
- if (response.headers.has("X-Astro-Reroute")) {
- response.headers.delete("X-Astro-Reroute");
+ if (response.headers.has('X-Astro-Reroute')) {
+ response.headers.delete('X-Astro-Reroute');
}
if (addCookieHeader) {
@@ -292,7 +295,7 @@ export class App {
response.headers.append('set-cookie', setCookieHeaderValue);
}
}
-
+
Reflect.set(response, responseSentSymbol, true);
return response;
}
diff --git a/packages/astro/src/core/pipeline.ts b/packages/astro/src/core/pipeline.ts
index 570d3b9ff..88b8e800d 100644
--- a/packages/astro/src/core/pipeline.ts
+++ b/packages/astro/src/core/pipeline.ts
@@ -4,7 +4,6 @@ import { callMiddleware } from './middleware/callMiddleware.js';
import { renderPage } from './render/core.js';
import { type Environment, type RenderContext } from './render/index.js';
-
type PipelineHooks = {
before: PipelineHookFunction[];
};
@@ -63,12 +62,7 @@ export class Pipeline {
for (const hook of this.#hooks.before) {
hook(renderContext, componentInstance);
}
- return await this.#tryRenderRoute(
- renderContext,
- this.env,
- componentInstance,
- this.#onRequest
- );
+ return await this.#tryRenderRoute(renderContext, this.env, componentInstance, this.#onRequest);
}
/**
diff --git a/packages/astro/src/runtime/server/endpoint.ts b/packages/astro/src/runtime/server/endpoint.ts
index 534133945..aec9c6a1b 100644
--- a/packages/astro/src/runtime/server/endpoint.ts
+++ b/packages/astro/src/runtime/server/endpoint.ts
@@ -41,6 +41,6 @@ export async function renderEndpoint(
const response = await handler.call(mod, context);
// Endpoints explicitly returning 404 or 500 response status should
// NOT be subject to rerouting to 404.astro or 500.astro.
- response.headers.set("X-Astro-Reroute", "no");
+ response.headers.set('X-Astro-Reroute', 'no');
return response;
}