Skip to content

Open-source status page, incident response and uptime monitoring

🚀 fix header (#850)

Thibault Le Ouay72bde1f274e4
diff --git a/apps/screenshot-service/src/index.ts b/apps/screenshot-service/src/index.ts
index 4d655ee02..2a0a16747 100644
--- a/apps/screenshot-service/src/index.ts
+++ b/apps/screenshot-service/src/index.ts
@@ -21,7 +21,7 @@ const S3 = new S3Client({
const app = new Hono();
app.get("/ping", (c) =>
- c.json({ ping: "pong", region: process.env.FLY_REGION }, 200),
+ c.json({ ping: "pong", region: process.env.FLY_REGION }, 200)
);
app.post(
@@ -32,10 +32,10 @@ app.post(
url: z.string().url(),
incidentId: z.number(),
kind: z.enum(["incident", "recovery"]),
- }),
+ })
),
async (c) => {
- const auth = c.req.header("Authorization");
+ const auth = c.req.header("api-key");
if (auth !== `Basic ${env.HEADER_TOKEN}`) {
console.error("Unauthorized");
return c.text("Unauthorized", 401);
@@ -60,7 +60,7 @@ app.post(
Bucket: "incident-screenshot",
Key: id,
ContentType: "image/png",
- }),
+ })
);
if (data.kind === "incident") {
@@ -94,7 +94,7 @@ app.post(
}
return c.text("Screenshot saved");
- },
+ }
);
export default app;
diff --git a/apps/server/src/checker/index.ts b/apps/server/src/checker/index.ts
index 858b767b5..02a9e6fea 100644
--- a/apps/server/src/checker/index.ts
+++ b/apps/server/src/checker/index.ts
@@ -267,7 +267,7 @@ const triggerScreenshot = async ({
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: `Basic ${env.CRON_SECRET}`,
+ "api-key": `Basic ${env.CRON_SECRET}`,
},
body: {
url: data.url,