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

Conversation

sanda87
Copy link

@sanda87 sanda87 commented Nov 26, 2019

Hello,
All our apps work on ports and we found out that bravado doesn't support host:port type for Header Authentication. The pull request adds the support.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.686% when pulling 57ad607 on sanda87:fix_api_key_auth into 25e5f5b on Yelp:master.

@@ -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

@sanda87 sanda87 requested a review from sjaensch December 16, 2019 10:07
@sjaensch sjaensch merged commit a708f4e into Yelp:master Dec 16, 2019
Copy link
Contributor

@sjaensch sjaensch left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

3 participants