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

Fix header authentication for host:port type #444

Merged
merged 3 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG-MASTER.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Changelog-Master
================

- Fix header authentication for host:port type
2 changes: 1 addition & 1 deletion bravado/requests_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def matches(self, url):
:return: True if matches host, port and scheme, False otherwise.
"""
split = urlparse.urlsplit(url)
return self.host == split.hostname
return self.host == split.netloc
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @sanda87, thanks for the PR and sorry for the late response!

While this works in your case, we should also either fix the docstring (we're not checking the scheme), or add that in here as well.

Could you also please add a test to make sure it works as expected, and so that there will be no regressions in the future? Maybe tests/http_client_test.py is a good fit for that.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @sjaensch ,
I added tests for this case and updated docstring in my new commit


def apply(self, request):
# type: (requests.Request) -> requests.Request
Expand Down