summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2012-03-21 16:26:32 +0100
committerrautenberg <rautenberg@in-silico.ch>2012-03-21 16:26:32 +0100
commit9b51fd3f058d96263e32665b3dd83e38ab30563d (patch)
tree063167d4c01d6c72539d845974bc5ce9c2668c36
parentbcbe8b69859dc666431e707ea529aa5ee9789712 (diff)
prevent ssl uris from URI.accessible? check
-rw-r--r--lib/rest-client-wrapper.rb4
1 files 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