diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-02 11:27:01 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-02 11:27:01 +0200 |
commit | 6a678d86e16ccab7d16a74c79a6a0b928007d532 (patch) | |
tree | d371aafc0cdb106050c86f03395a669c0bbfcf90 /netlib/http/exceptions.py | |
parent | 1c12e7c2b8bc04a2b01e21ac58771bc958a8ac8a (diff) | |
download | mitmproxy-6a678d86e16ccab7d16a74c79a6a0b928007d532.tar.gz mitmproxy-6a678d86e16ccab7d16a74c79a6a0b928007d532.tar.bz2 mitmproxy-6a678d86e16ccab7d16a74c79a6a0b928007d532.zip |
fix mitmproxy tests
Diffstat (limited to 'netlib/http/exceptions.py')
-rw-r--r-- | netlib/http/exceptions.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/netlib/http/exceptions.py b/netlib/http/exceptions.py index 45bd2dce..7cd26c12 100644 --- a/netlib/http/exceptions.py +++ b/netlib/http/exceptions.py @@ -1,5 +1,6 @@ -class HttpError(Exception): +from netlib import odict +class HttpError(Exception): def __init__(self, code, message): super(HttpError, self).__init__(message) self.code = code @@ -9,12 +10,13 @@ class HttpErrorConnClosed(HttpError): pass - class HttpAuthenticationError(Exception): def __init__(self, auth_headers=None): super(HttpAuthenticationError, self).__init__( "Proxy Authentication Required" ) + if isinstance(auth_headers, dict): + auth_headers = odict.ODictCaseless(auth_headers.items()) self.headers = auth_headers self.code = 407 |