Browse Source

server test

master
Cailean Finn 6 months ago
parent
commit
952e44d834
  1. 4
      server.js

4
server.js

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

Loading…
Cancel
Save