Refactor API key validation to use case-insensitive header name

This commit is contained in:
Aaro Varis
2024-09-29 18:24:29 +03:00
parent eb05e8aa0e
commit f1f53c9b85

View File

@@ -98,7 +98,7 @@ async function main() {
app.post('/:instanceId', async (req, res) => {
const apikey = req.headers['X-BatchHttp-Api-Key'];
const apikey = req.headers['x-batchhttp-api-key'];
if (apikey !== API_KEY) {
res.status(401).send({
error: "Invalid API Key"