X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fauth.py;h=27e2a980c260ff5318dfe02c0a7160a686a5d5a5;hp=18582140ad11e0b37befb02e84ed17e76fdc4f71;hb=c4b97e160d6f6a3e4ac6a940c1bda0c6759ca4e8;hpb=ab4f58a02fb66610c4bda3d4763f455e764c51be diff --git a/wrw/auth.py b/wrw/auth.py index 1858214..27e2a98 100644 --- a/wrw/auth.py +++ b/wrw/auth.py @@ -1,5 +1,5 @@ import binascii, hashlib, threading, time -from . import resp +from . import resp, proto class unauthorized(resp.httperror): def __init__(self, challenge, message=None, detail=None): @@ -31,11 +31,7 @@ def parsebasic(req): if mech != "basic": return None, None try: - data = data.encode("us-ascii") - except UnicodeError: - return None, None - try: - raw = binascii.a2b_base64(data) + raw = proto.unb64(data) except binascii.Error: return None, None try: