diff options
author | mr <mr@mrautenberg.de> | 2011-05-25 13:35:42 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-05-25 13:35:42 +0200 |
commit | 153c740268c1bf6255f14f80550f690179a72fd9 (patch) | |
tree | 6803d6af5fa7b14e4d9074c56612e858952e65f2 | |
parent | d0006c50909a7f134df4e246f747831e3a5547ed (diff) |
fix if subjectid is nil
-rw-r--r-- | lib/helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/helper.rb b/lib/helper.rb index 3a6126a..995f3e9 100644 --- a/lib/helper.rb +++ b/lib/helper.rb @@ -44,8 +44,9 @@ helpers do def uri_available?(urlStr) url = URI.parse(urlStr) + subjectidstr = @subjectid ? "?subjectid=#{CGI.escape @subjectid}" : "" Net::HTTP.start(url.host, url.port) do |http| - return http.head("#{url.request_uri}?subjectid=#{CGI.escape @subjectid}").code == "200" + return http.head("#{url.request_uri}#{subjectidstr}").code == "200" end end |