Phase 1: Add ESLint/Prettier config + baseline auto-fixes
This commit is contained in:
@@ -31,7 +31,7 @@ let buildRunning = false;
|
||||
function log(msg) {
|
||||
const line = `[webhook] ${new Date().toISOString()} ${msg}`;
|
||||
console.log(line);
|
||||
fs.appendFileSync(LOG_FILE, line + '\n');
|
||||
fs.appendFileSync(LOG_FILE, `${line }\n`);
|
||||
}
|
||||
|
||||
function verifySignature(body, signature) {
|
||||
@@ -39,7 +39,7 @@ function verifySignature(body, signature) {
|
||||
const hmac = crypto.createHmac('sha256', SECRET).update(body).digest('hex');
|
||||
return crypto.timingSafeEqual(
|
||||
Buffer.from(signature),
|
||||
Buffer.from(hmac)
|
||||
Buffer.from(hmac),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ const server = http.createServer((req, res) => {
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ accepted: true }));
|
||||
} catch (e) {
|
||||
log('Failed to parse webhook payload: ' + e.message);
|
||||
log(`Failed to parse webhook payload: ${ e.message}`);
|
||||
res.writeHead(400);
|
||||
res.end('Invalid payload');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user