From 7f86d46ae7ca5443838830cbbed64f29536159b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 27 Sep 2026 18:31:59 +0000 Subject: [PATCH] fix: validate backend bug report configuration before request Co-authored-by: MasterAcnolo <68693319+MasterAcnolo@users.noreply.github.com> --- app/sendReport.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/sendReport.js b/app/sendReport.js index c792cea..8ddb95a 100644 --- a/app/sendReport.js +++ b/app/sendReport.js @@ -35,10 +35,17 @@ async function sendReport(params) { } } - const response = await fetch(process.env.BUG_REPORT_URL, { + const reportUrl = process.env.BUG_REPORT_URL; + const reportApiKey = process.env.BUG_REPORT_API_KEY; + + if (!reportUrl || !reportApiKey) { + throw new Error("Bug report service is not configured. Missing BUG_REPORT_URL or BUG_REPORT_API_KEY on backend."); + } + + const response = await fetch(reportUrl, { method: "POST", headers: { - "X-Api-Key": process.env.BUG_REPORT_API_KEY + "X-Api-Key": reportApiKey }, body: formData });