From 8e3a3f679ea19b75c86eac9367d28cf704ac8485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 2 Oct 2018 15:35:20 +0200 Subject: [PATCH] Fixed issue with adding to the end of string on 429 error --- server/routing/client/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/routing/client/api.js b/server/routing/client/api.js index 4bd71265..6fb3419f 100644 --- a/server/routing/client/api.js +++ b/server/routing/client/api.js @@ -1405,7 +1405,8 @@ function checkTimeout(guid, res, authorized, type, callback) { var retry_in = (date.getTime() - now.getTime()) / 1000; if(retry_in > 0) { 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."; res.status(429).send(thisError); return;