diff options
author | Helmut Grohne <helmut@subdivi.de> | 2009-02-27 11:55:39 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2009-02-27 11:55:39 +0100 |
commit | 894ad7b53b22e8aa1ec8b4d6806b86c35e674086 (patch) | |
tree | 169ee07d5cbc3a2fb19fb725d6d9aab03ab89b76 /wsgitools/middlewares.py | |
parent | f6603653ff922bc84c48717e28392e88becbb8e0 (diff) | |
download | wsgitools-894ad7b53b22e8aa1ec8b4d6806b86c35e674086.tar.gz |
except binascii.Error instead of Exception in middlewares
Diffstat (limited to 'wsgitools/middlewares.py')
-rw-r--r-- | wsgitools/middlewares.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py index 146d7a5..297e646 100644 --- a/wsgitools/middlewares.py +++ b/wsgitools/middlewares.py @@ -3,6 +3,7 @@ __all__ = [] import time import sys import cgitb +import binascii from wsgitools.filters import CloseableList, CloseableIterator try: import cStringIO as StringIO @@ -300,7 +301,7 @@ class BasicAuthMiddleware: auth_type, enc_auth_info = auth.split(None, 1) try: auth_info = enc_auth_info.decode("base64") - except Exception: # It throws something from binascii. + except binascii.Error: return self.authorization_required(environ, start_response) if auth_type.lower() != "basic" or ':' not in auth_info: return self.authorization_required(environ, start_response) |