fix deprecation warning

This commit is contained in:
Anton Maminov 2021-11-18 10:10:05 +02:00
parent a247432bc4
commit b06e6b033a

View File

@ -170,7 +170,11 @@ class Mechanize
end end
# escape non-ascii character # escape non-ascii character
target_url = target_url.gsub(/[^#{0.chr}-#{126.chr}]/) { |match| target_url = target_url.gsub(/[^#{0.chr}-#{126.chr}]/) { |match|
URI.encode(match) {% if compare_versions(Crystal::VERSION, "1.1.1") > 0 %}
URI.encode_path(match)
{% else %}
URI.encode(match)
{% end %}
} }
target_url = URI.parse(target_url) target_url = URI.parse(target_url)
end end