Skip to content
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

[NT] Correct the hostname for proxy configurations with port numbers #2069

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

timdawborn
Copy link
Contributor

@timdawborn timdawborn commented Oct 10, 2023

Description, Motivation and Context

This PR fixes a bug in the proxy hostname parsing, where we currently accidentally use the wrong field from the parsed URL object to refer to the hostname of the proxy. https://developer.mozilla.org/en-US/docs/Web/API/URL — the host attribute is of the form <host>:<port> if present, whereas hostname is just <host>. How we use the parsed attribute expects just a hostname without a port number.

This PR fixes this bug by using the hostname attribute of the parsed URL instead of the host attribute. While I was here, I also added tests for this proxy URL parsing function given there were none before.

Checklist:

  • I've added/updated tests to cover my changes
  • I've created an issue associated with this PR

@timdawborn timdawborn marked this pull request as ready for review October 10, 2023 05:58
@timdawborn timdawborn requested a review from a team as a code owner October 10, 2023 05:58
@timdawborn timdawborn requested review from flavray and removed request for a team October 10, 2023 05:58
Copy link
Contributor

@flavray flavray left a comment

Choose a reason for hiding this comment

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

LGTM - The test suite is a nice addition too 👍

@timdawborn timdawborn merged commit 837de71 into master Oct 10, 2023
3 checks passed
@timdawborn timdawborn deleted the no-ticket-fix-proxy-host branch October 10, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants