summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-05-16 16:52:59 +0200
committerAndreas Maunz <andreas@maunz.de>2011-05-16 16:52:59 +0200
commit456acf01da2581ff186a607722eaa21ce6d54d85 (patch)
treeb6f17647ec6c912e3254da3c143649f300513bb7
parent5c6cb977db89b12ddeb822eb09370c9ad32ad84b (diff)
parent57b276f2d91bb3452f07c2e0d1803ced5ff1b35d (diff)
Merge branch 'development' of github.com:opentox/opentox-ruby into development
-rw-r--r--lib/helper.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/helper.rb b/lib/helper.rb
index af92419..3a6126a 100644
--- a/lib/helper.rb
+++ b/lib/helper.rb
@@ -44,14 +44,8 @@ helpers do
def uri_available?(urlStr)
url = URI.parse(urlStr)
- unless @subjectid
- Net::HTTP.start(url.host, url.port) do |http|
- return http.head(url.request_uri).code == "200"
- end
- else
- Net::HTTP.start(url.host, url.port) do |http|
- return http.post(url.request_uri, "subjectid=#{@subjectid}").code == "202"
- end
+ Net::HTTP.start(url.host, url.port) do |http|
+ return http.head("#{url.request_uri}?subjectid=#{CGI.escape @subjectid}").code == "200"
end
end