diff --git a/lib/better_errors/middleware.rb b/lib/better_errors/middleware.rb index 6eee8b4d..dac2ae5c 100644 --- a/lib/better_errors/middleware.rb +++ b/lib/better_errors/middleware.rb @@ -178,14 +178,14 @@ def no_errors_json_response "The application has been restarted since this page loaded, " + "or the framework is reloading all gems before each request " end - [200, { "Content-Type" => "text/plain; charset=utf-8" }, [JSON.dump( + [200, { "Content-Type" => "application/json; charset=utf-8" }, [JSON.dump( error: 'No exception information available', explanation: explanation, )]] end def invalid_error_json_response - [200, { "Content-Type" => "text/plain; charset=utf-8" }, [JSON.dump( + [200, { "Content-Type" => "application/json; charset=utf-8" }, [JSON.dump( error: "Session expired", explanation: "This page was likely opened from a previous exception, " + "and the exception is no longer available in memory.", @@ -193,7 +193,7 @@ def invalid_error_json_response end def invalid_csrf_token_json_response - [200, { "Content-Type" => "text/plain; charset=utf-8" }, [JSON.dump( + [200, { "Content-Type" => "application/json; charset=utf-8" }, [JSON.dump( error: "Invalid CSRF Token", explanation: "The browser session might have been cleared, " + "or something went wrong.",