From 9b51fd3f058d96263e32665b3dd83e38ab30563d Mon Sep 17 00:00:00 2001 From: rautenberg Date: Wed, 21 Mar 2012 16:26:32 +0100 Subject: prevent ssl uris from URI.accessible? check --- lib/rest-client-wrapper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index c9e6bbb..13ccf09 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -17,11 +17,11 @@ module OpenTox # check input bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? uri - not_found_error "URI '#{uri}' not found." unless URI.accessible? uri + not_found_error "URI '#{uri}' not found." unless URI.accessible? uri unless URI.ssl?(uri) bad_request_error "Headers are not a hash: #{headers.inspect}" unless headers==nil or headers.is_a?(Hash) # make sure that no header parameters are set in the payload [:accept,:content_type,:subjectid].each do |header| - bad_request_error "#{header} should be submitted in the headers" if payload and payload.is_a?(Hash) and payload[header] + bad_request_error "#{header} should be submitted in the headers" if payload and payload.is_a?(Hash) and payload[header] unless URI(uri).host == URI(AA).host end # create request -- cgit v1.2.3