From 1d49fe0da8e7d4dfc57fdbfffdc4e32db2ef0647 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 2 May 2012 20:06:16 +0000 Subject: initial task service --- lib/rest-client-wrapper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/rest-client-wrapper.rb') diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index 3071432..af1ba42 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -19,7 +19,7 @@ module OpenTox @subjectid = headers[:subjectid] ? headers[:subjectid] : nil bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? uri #TODO fix for internal installations - #not_found_error "URI '#{uri}' not found." unless URI.accessible?(uri, @subjectid) unless URI.ssl?(uri) + not_found_error "URI '#{uri}' not found." unless URI.accessible?(uri, @subjectid) 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| @@ -44,7 +44,9 @@ module OpenTox if [301, 302, 307].include? response.code and request.method == :get response.follow_redirection(request, result) else - raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri + #TODO Reactivate for external services + #raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri + rest_call_error response.to_s, request, uri unless response.code < 400 or URI.task? uri response end end -- cgit v1.2.3 From 8b430fdfb285cbbb24116909c7fe69a424b522d2 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 3 May 2012 12:48:06 +0200 Subject: remote task tests working --- lib/rest-client-wrapper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/rest-client-wrapper.rb') diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index af1ba42..d5d9c82 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -44,9 +44,7 @@ module OpenTox if [301, 302, 307].include? response.code and request.method == :get response.follow_redirection(request, result) else - #TODO Reactivate for external services - #raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri - rest_call_error response.to_s, request, uri unless response.code < 400 or URI.task? uri + raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri response end end -- cgit v1.2.3 From 8a5e3d69a16fc0c7d551e000270fe243ed121c85 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 4 May 2012 10:29:55 +0000 Subject: ntriples as default format, rdfxml as fallback --- lib/rest-client-wrapper.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/rest-client-wrapper.rb') diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index d5d9c82..479d5a5 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -18,7 +18,6 @@ module OpenTox # check input @subjectid = headers[:subjectid] ? headers[:subjectid] : nil bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? uri - #TODO fix for internal installations not_found_error "URI '#{uri}' not found." unless URI.accessible?(uri, @subjectid) 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 -- cgit v1.2.3