lib/nunchaku/checker.rb in nunchaku-0.2.0 vs lib/nunchaku/checker.rb in nunchaku-0.2.1
- old
+ new
@@ -34,12 +34,16 @@
def vnu_request
HTTParty.get(vnu_request_querystring).body
end
def vnu_request_querystring
- s = "#{checker_uri}?out=json&doc=#{@url}"
- s += "&useragent=#{@user_agent}" if @user_agent
+ s = "#{checker_uri}?out=json&doc=#{escaped @url}"
+ s += "&useragent=#{escaped @user_agent}" if @user_agent
s
+ end
+
+ def escaped(str)
+ CGI::escape str
end
def defaults
{ checker_uri: 'http://validator.w3.org/nu/' }
end