Created
May 8, 2017 03:49
-
-
Save indyarocks/b7303c9a277803a18562f0b4f65ba8cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
chandan@~/Workspace/Faodail/OpenSource ○ ➜ irb | |
2.4.0 :001 > require 'final_redirect_url' | |
=> true | |
2.4.0 :002 > FinalRedirectUrl.final_redirect_url('') | |
=> "" | |
2.4.0 :003 > FinalRedirectUrl.final_redirect_url('http://google.com') | |
redirected to http://www.google.co.in/?gfe_rd=cr&ei=e-oPWaSoHaX98wfuqYuoCw | |
=> "http://www.google.co.in/?gfe_rd=cr&ei=e-oPWaSoHaX98wfuqYuoCw" | |
2.4.0 :004 > FinalRedirectUrl.final_redirect_url('http://google.co.in') | |
redirected to http://www.google.co.in/ | |
=> "http://www.google.co.in/" | |
2.4.0 :005 > FinalRedirectUrl.final_redirect_url('https://google.co.in') | |
redirected to https://www.google.co.in/ | |
=> "https://www.google.co.in/" | |
2.4.0 :006 > FinalRedirectUrl.final_redirect_url('https://www.google.co.in') | |
=> "https://www.google.co.in/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment