-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP::URI.parse doesn’t set default port #297
Comments
Definitely sounds like the correct behavior to me, and a bug in Addressable... |
@tarcieri I just reading the Addressable source code. They solve this by providing |
I'd agree with @tarcieri. It's annoying that it broke between the two, but returning a nil makes sense to me. Having an explicit method is 👍 |
@sferik hmm, I think it's a bit strange that |
@sferik We can do that in our inherited URI class |
@tarcieri re removing Addressable. Before doing that we should first do our own research.
Yes, But I don't see how something that simply does not fit our need but lightweight might be better ;)) |
@ixti sure, I don't think there's even an open issue about removing Addressable, just some discussion. I was just throwing it out there as something that has come up in the past. |
@tarcieri Yeah. I guess I wrote that up mostly for myself ;)) as in that discussion I was on the side of removing it :D |
For reference. Discussion @tarcieri and I were talking about is: #197 (comment) |
I made an issue for a 2.0.0 release: #321 |
@tarcieri Thanks. Other than this, I don’t have any 2.0 blockers. |
I don't think we should get rid of Addressable completely. Maximum what I think we should do (if we want to get rid of hard addressable dependency) is to provide our own class for URI, that will use internally stdlib URI by default and will be able to handle URIs with addressable: |
Yeah, let's get rid of |
The
http
gem changed to how it creates URIs between version 0.7 and 0.8. Versions 0.7 and earlier used the standardURI
library, while more recent versions use a customHTTP::URI
, which descends fromAddressable::URI
.After upgrading
http
dependency in thetwitter
gem from 0.6 to 0.8 (and now to 1.0), some code that expected the default port to be set is now broken. You can read a detailed write up of the issue, with the relevant portion reproduced below:http
gem 0.7.x and earlierhttp
gem 0.8.x and later@tarcieri @zanker @ixti How would you feel about adding back the default ports (80 for HTTP and 443 for HTTPS) if an explicit port is not specified?
Quoting from RFC 7230, section 2.7.1 on http URI Scheme:
And the subsequent section on the https URI Scheme:
If we all agree this is the correct behavior, I will work on a patch.
The text was updated successfully, but these errors were encountered: