diff options
-rw-r--r-- | lib/helper.rb | 10 |
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 |