-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
assign default port for http and https #9439
Conversation
If one wanted to be pedantic, the "proper" way to do this might be |
d543d99
to
8d2b4de
Compare
I've updated it to use
|
8d2b4de
to
a095901
Compare
I found that Updated the PR to hardcode port 80 for http and 443 for https. These values are hardcoded elsewhere in the code so nothing new. Bump to be included in the next release with the release PR: #9438 |
This possibility worried me. Furthermore, one person's feature is another's bug: a "functioning" service database which returns different ports could create problems for ordinary users. Given that there's an IANA service/port registry which includes 80 and 443, and that registry won't be changing any time soon, one could argue that making the lookup dynamic would only create wrong behaviors (i.e. strictly downside, because it's certainly slower).
It might be helpful to make (and use) a shared utility function in the future. But, in the interest of timeliness, I agree with the route you've chosen. |
@nahuhh Raised a good point, which is that P2P for I2P (e.g. tx-proxy) uses default port 0. We want to ensure we're not incorrectly overriding the default port in this case. I'm not sure if that's an issue here or not. Maybe someone more knowledgeable will know if this code path is used for that? |
I would not have approved it if this were an issue: This function sets the server to which an HTTP client connects, port 0 is not a valid port, that is precisely why it's used to mean "default" or "any" in networking contexts, just like 0.0.0.0 means the same for IPv4 addresses. |
a095901
to
02e2a4f
Compare
No description provided.