##// END OF EJS Templates
py3: byteify an inline python test extension...
Matt Harbison -
r39867:91d63fd5 default
parent child Browse files
Show More
@@ -424,12 +424,12 b' a large file from the server rather than'
424 > import base64
424 > import base64
425 > from mercurial.hgweb import common
425 > from mercurial.hgweb import common
426 > def perform_authentication(hgweb, req, op):
426 > def perform_authentication(hgweb, req, op):
427 > auth = req.headers.get('Authorization')
427 > auth = req.headers.get(b'Authorization')
428 > if not auth:
428 > if not auth:
429 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
429 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
430 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
430 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
431 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
431 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
432 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
432 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
433 > def extsetup():
433 > def extsetup():
434 > common.permhooks.insert(0, perform_authentication)
434 > common.permhooks.insert(0, perform_authentication)
435 > EOT
435 > EOT
General Comments 0
You need to be logged in to leave comments. Login now