From 3167722af239dafc910b20359efc94334cd2ee3f Mon Sep 17 00:00:00 2001 From: "wade@bindshell.net" Date: Thu, 11 Aug 2011 01:52:45 +0000 Subject: [PATCH] Fixes issue 436. IE can now be hooked cross domain. Loading script is used instead of ajax now. git-svn-id: https://beef.googlecode.com/svn/trunk@1180 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/main/client/net.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/core/main/client/net.js b/core/main/client/net.js index 72d7dad0b..af4ed6150 100644 --- a/core/main/client/net.js +++ b/core/main/client/net.js @@ -187,15 +187,14 @@ beef.net = { //build and execute the request $j.ajax({type: method, - - //dataType: dataType, + dataType: 'script', // this is required for bugs in IE so data can be transfered back to the server url: url, data: data, timeout: (timeout * 1000), //function on success success: function(data, textStatus, xhr){ var end_time = new Date().getTime(); - response.status_code = textStatus; + response.status_code = textStatus; response.response_body = data; response.port_status = "open"; response.was_timedout = false; @@ -274,8 +273,7 @@ beef.net = { //build and execute the request $j.ajax({type: method, - - //dataType: dataType, + dataType: 'script', // this is required for bugs in IE so data can be transfered back to the server url: url, data: data, timeout: (timeout * 1000), @@ -283,28 +281,28 @@ beef.net = { //function on success success: function(data, textStatus, xhr){ var end_time = new Date().getTime(); - response.status_code = xhr.status; - response.status_text = textStatus; + response.status_code = xhr.status; + response.status_text = textStatus; response.response_body = data; response.port_status = "open"; response.was_timedout = false; response.duration = (end_time - start_time); }, //function on failure - error: function(xhr, textStatus, errorThrown){ - var end_time = new Date().getTime(); + error: function(xhr, textStatus, errorThrown){ + var end_time = new Date().getTime(); if (textStatus == "timeout"){response.was_timedout = true; response.port_status = "closed"; } else { response.port_status = "open"; } - response.response_body = xhr.responseText; + response.response_body = xhr.responseText; response.status_code = xhr.status; - response.status_text = textStatus; + response.status_text = textStatus; response.duration = (end_time - start_time); }, //function on completion complete: function(xhr, textStatus) { response.status_code = xhr.status; - response.status_text = textStatus; - response.headers = xhr.getAllResponseHeaders(); - callback(response, requestid); + response.status_text = textStatus; + response.headers = xhr.getAllResponseHeaders(); + callback(response, requestid); } }); return response;