whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Set http.use_ssl consistently
Date Tue, 17 May 2016 21:12:51 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  84ff8a9   Set http.use_ssl consistently
84ff8a9 is described below

commit 84ff8a96544e4e95572cf5cc5580a311522134c3
Author: Sebb <sebb@apache.org>
AuthorDate: Tue May 17 22:12:41 2016 +0100

    Set http.use_ssl consistently
---
 tools/mirror_check.rb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/mirror_check.rb b/tools/mirror_check.rb
index b94a4b8..ad180ca 100755
--- a/tools/mirror_check.rb
+++ b/tools/mirror_check.rb
@@ -93,6 +93,7 @@ def getHTTPHdrs(url)
   url.untaint
   uri = URI.parse(url)
   http = Net::HTTP.new(uri.host, uri.port)
+  http.use_ssl = uri.scheme == 'https'
   request = Net::HTTP::Head.new(uri.request_uri)
   http.request(request)
 end
@@ -101,7 +102,7 @@ def check_CT(base, page, severity=:E, expectedStatus = 200)
   path = base + page
   response = getHTTPHdrs(path)
   if response.code.to_i != expectedStatus
-    test severity, "HTTP status #{response.code} for #{path}" unless severity == nil
+    test severity, "HTTP status #{response.code} for '#{path}'" unless severity == nil
     return nil
   end
   ct = response['Content-Type'] || 'unknown'
@@ -119,10 +120,7 @@ def getHTTP(url)
   url.untaint
   uri = URI.parse(url)
   http = Net::HTTP.new(uri.host, uri.port)
-  if uri.scheme == 'https'
-    http.use_ssl = true
-    http.verify_mode = OpenSSL::SSL::VERIFY_NONE 
-  end
+  http.use_ssl = uri.scheme == 'https'
   request = Net::HTTP::Get.new(uri.request_uri)
   http.request(request)
 end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message