Skip to content

Use default port 443 in HTTP CONNECT request#26331

Merged
yashykt merged 4 commits into
grpc:masterfrom
yashykt:httpconnectdefaultport
Jun 9, 2021
Merged

Use default port 443 in HTTP CONNECT request#26331
yashykt merged 4 commits into
grpc:masterfrom
yashykt:httpconnectdefaultport

Conversation

@yashykt

@yashykt yashykt commented May 21, 2021

Copy link
Copy Markdown
Member

Fix #26227

@yashykt yashykt requested a review from markdroth as a code owner May 21, 2021 03:52
@yashykt yashykt added release notes: yes Indicates if PR needs to be in release notes lang/core labels May 21, 2021
absl::string_view port;
SplitHostPort(target, &host, &port);
if (port.empty()) {
return JoinHostPort(host, 443);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd ideally prefer not to hard-code the default this way, independently of the default in the DNS resolver that specifies the same thing. But unfortunately, I don't have a better suggestion for how to handle this, so I guess we can live with it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make it a constant. Something like kDefaultSecurePort that is shared between the resolver and this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fine. It's already defined independently in both of the DNS resolver implementations:

Comment thread src/core/ext/filters/client_channel/http_proxy.cc Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang/core release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http_proxy support can issue non-compliant CONNECT requests

2 participants