lib/rodauth/features/json.rb in rodauth-2.22.0 vs lib/rodauth/features/json.rb in rodauth-2.23.0

- old
+ new

@@ -154,12 +154,11 @@ json_response[json_response_error_key] = json_non_post_error_message return_json_response end elsif only_json? response.status = json_response_error_status - response.write non_json_request_error_message - request.halt + return_response non_json_request_error_message end super end @@ -173,11 +172,10 @@ end def _return_json_response response.status ||= json_response_error_status if json_response[json_response_error_key] response['Content-Type'] ||= json_response_content_type - response.write(_json_response_body(json_response)) - request.halt + return_response _json_response_body(json_response) end def include_success_messages? !json_response_success_key.nil? end