diff --git a/bravado/requests_client.py b/bravado/requests_client.py index 9234b391..ce30fac5 100644 --- a/bravado/requests_client.py +++ b/bravado/requests_client.py @@ -20,7 +20,7 @@ class Authenticator(object): """Authenticates requests. - :param host: Host to authenticate for. + :param host: Host to authenticate for. In some case """ def __init__(self, host): @@ -33,10 +33,11 @@ def matches(self, url): """Returns true if this authenticator applies to the given url. :param url: URL to check. - :return: True if matches host, port and scheme, False otherwise. + :return: True if matches host, False otherwise. """ + host_without_port = self.host.split(':')[0] split = urlparse.urlsplit(url) - return self.host == split.hostname + return host_without_port == split.hostname def apply(self, request): """Apply authentication to a request.