From 8feef887b95a64b499309a964f69177aad00f2ef Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Sun, 15 Apr 2012 11:56:00 +0100 Subject: [PATCH] Fixed issue with malformed JSON response (missing }). No using hash.to_json to send response. --- core/main/rest/handlers/admin.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/main/rest/handlers/admin.rb b/core/main/rest/handlers/admin.rb index c5ffd9f08..d36935bfe 100644 --- a/core/main/rest/handlers/admin.rb +++ b/core/main/rest/handlers/admin.rb @@ -58,7 +58,9 @@ module BeEF BeEF::Core::Logger.instance.register('Authentication', "User with ip #{request.ip} has failed to authenticate in the application.") halt 401 else - '{"success":"true","token":"' + config.get('beef.api_token') + '"' + { "success" => true, + "token" => "#{config.get('beef.api_token')}" + }.to_json end rescue Exception => e error 400