Skip to content

Commit

Permalink
return when limit <= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
indyarocks committed Nov 1, 2018
1 parent f9fdebe commit 6b672e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/final_redirect_url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def self.is_valid_url?(url)
end

def self.get_final_redirect_url(url, limit = 10)
return url if limit <= 0
uri = URI.parse(url)
response = ::Net::HTTP.get_response(uri)
if response.class == Net::HTTPOK
Expand Down

0 comments on commit 6b672e7

Please sign in to comment.