Skip to content

Commit

Permalink
Updated URI.encode call
Browse files Browse the repository at this point in the history
  • Loading branch information
gragtah authored and quark-zju committed Aug 1, 2023
1 parent 7e0278c commit 59aac7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/unshorten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def follow(url, options = DEFAULT_OPTIONS, level = 0) #:nodoc:

if response.is_a?(Net::HTTPRedirection) && options[:follow_codes].include?(response.code.to_i) && response['location'] then
expire_cache if @@cache.size > CACHE_SIZE_LIMIT
location = URI.encode(response['location'])
location = Addressable::URI.encode(response['location'])
location = (uri + location).to_s if location
@@cache[url] = follow(location, options, level + 1)
else
Expand Down

0 comments on commit 59aac7c

Please sign in to comment.