mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-28 12:31:14 +02:00
fix: validate backend bug report configuration before request
Co-authored-by: MasterAcnolo <68693319+MasterAcnolo@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
187e3af559
commit
7f86d46ae7
@@ -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",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"X-Api-Key": process.env.BUG_REPORT_API_KEY
|
"X-Api-Key": reportApiKey
|
||||||
},
|
},
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user