Merge pull request #288 from vzctl/master

Add open timeout for the ruby driver
main
Elbert Alias 12 years ago
commit 606a989090

@ -14,7 +14,7 @@ class Wappalyzer
def analyze(url) def analyze(url)
uri, body, headers = URI(url), nil, {} uri, body, headers = URI(url), nil, {}
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => 5) do |http|
resp = http.get(uri.request_uri) resp = http.get(uri.request_uri)
resp.canonical_each{|k,v| headers[k] = v} resp.canonical_each{|k,v| headers[k] = v}
body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace) body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace)

Loading…
Cancel
Save