web/request.py
changeset 8695 358d8bed9626
parent 8645 310040c668c0
child 8696 0bb18407c053
equal deleted inserted replaced
8694:d901c36bcfce 8695:358d8bed9626
   878             try:
   878             try:
   879                 assert scheme == "basic"
   879                 assert scheme == "basic"
   880                 user, passwd = base64.decodestring(rest).split(":", 1)
   880                 user, passwd = base64.decodestring(rest).split(":", 1)
   881                 # XXX HTTP header encoding: use email.Header?
   881                 # XXX HTTP header encoding: use email.Header?
   882                 return user.decode('UTF8'), passwd
   882                 return user.decode('UTF8'), passwd
   883             except Exception, ex:
   883             except Exception as ex:
   884                 self.debug('bad authorization %s (%s: %s)',
   884                 self.debug('bad authorization %s (%s: %s)',
   885                            auth, ex.__class__.__name__, ex)
   885                            auth, ex.__class__.__name__, ex)
   886         return None, None
   886         return None, None
   887 
   887 
   888     def parse_accept_header(self, header):
   888     def parse_accept_header(self, header):