From ebf1db24f13505ea34dfc4efea742cae9e5224ae Mon Sep 17 00:00:00 2001 From: janani21 Date: Tue, 22 Oct 2019 13:20:24 +0530 Subject: [PATCH] Correcting rate_limit message format for application/json --- lib/rate_limiting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rate_limiting.rb b/lib/rate_limiting.rb index 88b4e53..8a7a1c3 100644 --- a/lib/rate_limiting.rb +++ b/lib/rate_limiting.rb @@ -25,7 +25,7 @@ def respond(env, limit_header) def rate_limit_exceeded(accept) case accept.gsub(/;.*/, "").split(',')[0] when "text/xml" then message, type = xml_error("403", "Rate Limit Exceeded"), "text/xml" - when "application/json" then message, type = ["Rate Limit Exceeded"].to_json, "application/json" + when "application/json" then message, type = ["Rate Limit Exceeded"], "application/json" else message, type = ["Rate Limit Exceeded"], "text/html" end