|
|
@ -69,7 +69,9 @@ app.post('/api', (req, res) => { |
|
|
|
const digest = hmac.update(payload).digest('hex'); |
|
|
|
const bufferSignature = Buffer.from(signature, 'hex'); |
|
|
|
const bufferDigest = Buffer.from(digest, 'hex'); |
|
|
|
|
|
|
|
|
|
|
|
console.log(bufferSignature.length, bufferDigest.length) |
|
|
|
|
|
|
|
if (bufferSignature.length === bufferDigest.length && crypto.timingSafeEqual(bufferSignature, bufferDigest)) { |
|
|
|
// Secret is valid, update the repository
|
|
|
|
res.status(200).send('Repository updated successfully'); |
|
|
|