Openstatus www.openstatus.dev

๐Ÿš€ fix header (#850)

authored by

Thibault Le Ouay and committed by
GitHub
72bde1f2 5a8c1068

+6 -6
+5 -5
apps/screenshot-service/src/index.ts
··· 21 21 const app = new Hono(); 22 22 23 23 app.get("/ping", (c) => 24 - c.json({ ping: "pong", region: process.env.FLY_REGION }, 200), 24 + c.json({ ping: "pong", region: process.env.FLY_REGION }, 200) 25 25 ); 26 26 27 27 app.post( ··· 32 32 url: z.string().url(), 33 33 incidentId: z.number(), 34 34 kind: z.enum(["incident", "recovery"]), 35 - }), 35 + }) 36 36 ), 37 37 async (c) => { 38 - const auth = c.req.header("Authorization"); 38 + const auth = c.req.header("api-key"); 39 39 if (auth !== `Basic ${env.HEADER_TOKEN}`) { 40 40 console.error("Unauthorized"); 41 41 return c.text("Unauthorized", 401); ··· 60 60 Bucket: "incident-screenshot", 61 61 Key: id, 62 62 ContentType: "image/png", 63 - }), 63 + }) 64 64 ); 65 65 66 66 if (data.kind === "incident") { ··· 94 94 } 95 95 96 96 return c.text("Screenshot saved"); 97 - }, 97 + } 98 98 ); 99 99 100 100 export default app;
+1 -1
apps/server/src/checker/index.ts
··· 267 267 method: "POST", 268 268 headers: { 269 269 "Content-Type": "application/json", 270 - Authorization: `Basic ${env.CRON_SECRET}`, 270 + "api-key": `Basic ${env.CRON_SECRET}`, 271 271 }, 272 272 body: { 273 273 url: data.url,