raise tornado.web.HTTPError(400, "Can only handle Basic auth.")
try:
- # Decode the authentication information.
- auth_header = base64.decodestring(auth_header[6:])
+ # Convert into bytes()
+ auth_header = auth_header[6:].encode()
+
+ # Decode base64
+ auth_header = base64.b64decode(auth_header).decode()
name, password = auth_header.split(":", 1)
except:
def prepare(self):
# The request must come from an authenticated buider.
if not self.builder:
- raise tornado.web.HTTPError(403)
+ raise tornado.web.HTTPError(403, "Not authenticated as a builder")
class BuildersInfoHandler(BuildersBaseHandler):