summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2017-06-09 11:08:45 +0000
committergebele <gebele@in-silico.ch>2017-06-09 11:08:45 +0000
commit710031f953429c6e1a76aff4984ee76f7a1ee485 (patch)
treeb56de76f91500ba72edfb22396dfe9547616eeaa /lib
parent9aa5203dd375225996c1efe4be1a4324ddc6cda7 (diff)
added addressable gem to avoid URI::InvalidURIError
Diffstat (limited to 'lib')
-rw-r--r--lib/lazar.rb1
-rw-r--r--lib/overwrite.rb2
-rw-r--r--lib/rest-client-wrapper.rb1
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/lazar.rb b/lib/lazar.rb
index a756742..fff5598 100644
--- a/lib/lazar.rb
+++ b/lib/lazar.rb
@@ -1,6 +1,7 @@
require 'rubygems'
require "bundler/setup"
require "rest-client"
+require 'addressable'
require 'yaml'
require 'json'
require 'logger'
diff --git a/lib/overwrite.rb b/lib/overwrite.rb
index 91bc9e1..89e57a0 100644
--- a/lib/overwrite.rb
+++ b/lib/overwrite.rb
@@ -197,7 +197,7 @@ module URI
# @param [String]
# @return [TrueClass,FalseClass]
def self.valid? uri
- u = URI.parse(uri)
+ u = Addressable::URI.parse(uri)
u.scheme!=nil and u.host!=nil
rescue URI::InvalidURIError
false
diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb
index f76a296..c9fd40f 100644
--- a/lib/rest-client-wrapper.rb
+++ b/lib/rest-client-wrapper.rb
@@ -26,6 +26,7 @@ module OpenTox
define_singleton_method method do |uri,payload={},headers={},waiting_task=nil|
+ uri = Addressable::URI.encode(uri)
# check input
bad_request_error "Headers are not a hash: #{headers.inspect} for #{uri}." unless headers==nil or headers.is_a?(Hash)
headers[:subjectid] ||= @@subjectid