Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
prosif committed Nov 24, 2024
1 parent 8110ed8 commit 5a68d5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ const handleCertRequest = (publicIp) => new Promise((resolve, reject) => {
reject('Certs not available in this environment');
} else {
getCertStatus(publicIp).then(certInfo => {
if (certInfo.certData && certInfo.certExpiration && certInfo.certExpiration > Date.now()) {
if (certInfo.cert && certInfo.certExpiration && certInfo.certExpiration > Date.now()) {
reject('A valid cert has already been created for this IP (' + publicIp + '). If you do not have access to your private key, contact us to generate a new one');
} else {
amqp.connect(`amqp://${QUEUE_HOST}`, (err, conn) => {
Expand Down Expand Up @@ -2174,6 +2174,10 @@ const server = http.createServer((req, res) => {
console.log(body);
res.end(JSON.stringify(body));
});
}).catch(err => {
// todo: have better status codes. this is only one reason an error would be thrown
res.writeHead(400);
res.end(err);
});
}
},
Expand Down

0 comments on commit 5a68d5a

Please sign in to comment.