Created
August 25, 2011 17:15
-
-
Save osak/1171185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: tco.rb | |
=================================================================== | |
--- tco.rb (リビジョン 478) | |
+++ tco.rb (作業コピー) | |
@@ -24,7 +24,7 @@ | |
end | |
def expand_url(url) | |
hash = Hash.new | |
- res = Net::HTTP.get_response(URI.parse(url)) | |
+ res = Net::HTTP.get_response(URI.parse(url)) rescue nil | |
if res.is_a?(Net::HTTPRedirection) | |
return res["location"] | |
else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment