summaryrefslogtreecommitdiff
path: root/wsgitools/middlewares.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/middlewares.py')
-rw-r--r--wsgitools/middlewares.py3
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)