- send_error("disabled", status: 404)
- else
- auth_header = request.headers['Authorization']
- if !auth_header
- send_error("authorization required", status: 401)
- elsif auth_header != 'Bearer '+mgmt_token
- send_error("authorization error", status: 403)
- end
+ send_json ({"errors" => "disabled"}), status: 404
+ elsif !auth_header
+ send_json ({"errors" => "authorization required"}), status: 401
+ elsif auth_header != 'Bearer '+mgmt_token
+ send_json ({"errors" => "authorization error"}), status: 403