Fixed issue with adding to the end of string on 429 error

This commit is contained in:
Kasper Rynning-Tønnesen
2018-10-02 15:35:20 +02:00
parent 90538377fb
commit 8e3a3f679e

View File

@@ -1405,7 +1405,8 @@ function checkTimeout(guid, res, authorized, type, callback) {
var retry_in = (date.getTime() - now.getTime()) / 1000; var retry_in = (date.getTime() - now.getTime()) / 1000;
if(retry_in > 0) { if(retry_in > 0) {
res.header({'Retry-After': retry_in}); res.header({'Retry-After': retry_in});
var thisError = error.tooMany; var thisErrorString = JSON.stringify(error.tooMany);
var thisError = JSON.parse(thisErrorString);
thisError.error += " To get an API-key, visit https://zoff.me/api/apply."; thisError.error += " To get an API-key, visit https://zoff.me/api/apply.";
res.status(429).send(thisError); res.status(429).send(thisError);
return; return;