diff options
| author | Dariusz Górecki <darek.krk@gmail.com> | 2016-07-02 15:16:45 +0100 |
|---|---|---|
| committer | Dariusz Górecki <darek.krk@gmail.com> | 2016-07-02 15:16:45 +0100 |
| commit | 362a5812733ccc97336cea9ba5b1deebc3120ab2 (patch) | |
| tree | d09ce4d92fffd472132ac31044368a23742bf3cd | |
| parent | c895f874184371ff5798748b1c7234128ca4b25e (diff) | |
| download | pyramid-362a5812733ccc97336cea9ba5b1deebc3120ab2.tar.gz pyramid-362a5812733ccc97336cea9ba5b1deebc3120ab2.tar.bz2 pyramid-362a5812733ccc97336cea9ba5b1deebc3120ab2.zip | |
Remove WebOb related logic
| -rw-r--r-- | pyramid/authentication.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/pyramid/authentication.py b/pyramid/authentication.py index 95d6a710d..c6fd8f466 100644 --- a/pyramid/authentication.py +++ b/pyramid/authentication.py @@ -1169,18 +1169,13 @@ def extract_http_basic_credentials(request): ``request`` The request object """ + authorization = request.headers.get('Authorization') + if not authorization: + return None + try: - # First try authorization extraction logic from WebOb - try: - authmeth, auth = request.authorization - except AttributeError: # Probably a DummyRequest - authorization = request.headers.get('Authorization') - if not authorization: - return None - - authmeth, auth = authorization.split(' ', 1) - except (ValueError, TypeError): - # not enough values to unpack or None is not iterable + authmeth, auth = authorization.split(' ', 1) + except ValueError: # not enough values to unpack return None if authmeth.lower() != 'basic': |
