Created
October 18, 2016 15:33
-
-
Save xfalcox/12bfc4c782efa7e7ef3023bab1b0c18d to your computer and use it in GitHub Desktop.
Ruby URI is strange
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
url = '//example.com?a=1' | |
#=> "//example.com?a=1" | |
uri = URI(url) | |
#=> #<URI::Generic //example.com?a=1> | |
uri.request_uri | |
#NoMethodError: undefined method `request_uri' for #<URI::Generic //example.com?a=1> | |
url = 'https://example.com?a=1' | |
#=> "https://example.com?a=1" | |
uri = URI(url) | |
=> #<URI::HTTPS https://example.com?a=1> | |
uri.request_uri | |
#=> "/?a=1" | |
# WAT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment