From b6f909ee5dab7b76b47c275ad3250ed31854bbfb Mon Sep 17 00:00:00 2001 From: hiimgoodpack Date: Fri, 26 Mar 2021 10:59:24 -0400 Subject: [PATCH] Put rate limited error in JSON --- brainlet/api/v1/users.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/brainlet/api/v1/users.js b/brainlet/api/v1/users.js index ebde64b..fb7fb9d 100755 --- a/brainlet/api/v1/users.js +++ b/brainlet/api/v1/users.js @@ -15,7 +15,10 @@ const app = express.Router(); const createAccountLimiter = rateLimit({ windowMs: 60 * 60 * 1000, // 1 hour window max: 10, // start blocking after 5 requests - message: "You are being rate limited" + message: JSON.stringify({ + error: true, + message: "ERROR_RATE_LIMITED" + }) }); mongoose.connect(config.mongoUrl, {useNewUrlParser: true, useUnifiedTopology: true}); @@ -211,4 +214,4 @@ app.post("/browser/token/clear", authenticateEndpoint((req, res) => { res.sendStatus(200); })); -module.exports = app; \ No newline at end of file +module.exports = app; -- 2.30.2