Merge pull request #1 from dctabuyz/encodeIDN

IDN support: encode non-ascii domain names
This commit is contained in:
dctabuyz
2015-01-07 14:03:50 +05:00
3 changed files with 8 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ begin
require 'nokogiri'
require 'terminal-table'
require 'ruby-progressbar'
require 'addressable/uri'
# Custom libs
require 'common/browser'
require 'common/custom_option_parser'

View File

@@ -55,6 +55,8 @@ class WpscanOptions
def url=(url)
raise Exception.new('Empty URL given') if url.nil? || url == ''
url = Addressable::URI.parse(url).normalize.to_s unless url.ascii_only?
@url = URI.parse(add_http_protocol(url)).to_s
end

View File

@@ -32,6 +32,11 @@ describe 'WpscanOptions' do
@wpscan_options.url = url
expect(@wpscan_options.url).to be === url
end
it 'should encode IDN' do
@wpscan_options.url = 'http://пример.испытание/'
expect(@wpscan_options.url).to be === 'http://xn--e1afmkfd.xn--80akhbyknj4f/'
end
end
describe '#threads=' do