Possible fix towards the CORS issues in Chrome etc
git-svn-id: https://beef.googlecode.com/svn/trunk@679 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -24,6 +24,9 @@ module BeEF
|
||||
#
|
||||
def do_POST(request, response)
|
||||
|
||||
response.header['Access-Control-Allow-Origin'] = '*'
|
||||
response.header['Access-Control-Allow-Methods'] = 'POST, GET'
|
||||
response.header['Access-Control-Allow-Headers'] = 'Content-Type'
|
||||
response.body = ''
|
||||
|
||||
# validate hook session value
|
||||
@@ -96,6 +99,8 @@ module BeEF
|
||||
|
||||
end
|
||||
|
||||
alias do_OPTIONS do_POST
|
||||
|
||||
# returns a selected parameter from the query string.
|
||||
def get_param(query, key)
|
||||
return nil if query[key].nil?
|
||||
|
||||
@@ -74,11 +74,13 @@ module BeEF
|
||||
response.header['Content-Type'] = 'text/javascript'
|
||||
response.header['Access-Control-Allow-Origin'] = '*'
|
||||
response.header['Access-Control-Allow-Methods'] = 'POST, GET'
|
||||
response.header['Access-Control-Allow-Headers'] = 'Content-Type'
|
||||
response.body = @body
|
||||
|
||||
end
|
||||
|
||||
alias do_POST do_GET
|
||||
alias do_OPTIONS do_GET
|
||||
|
||||
private
|
||||
|
||||
|
||||
Reference in New Issue
Block a user