##// END OF EJS Templates
run-tests: allow spaces in the --view tool...
run-tests: allow spaces in the --view tool Most tools on Windows are in Program Files, and not necessarily on PATH.

File last commit:

r41725:549af2fa default
r41726:7855a949 default
Show More
httpserverauth.py
17 lines | 554 B | text/x-python | PythonLexer
from __future__ import absolute_import
import base64
from mercurial.hgweb import common
def perform_authentication(hgweb, req, op):
auth = req.headers.get(b'Authorization')
if not auth:
raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
[(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
def extsetup(ui):
common.permhooks.insert(0, perform_authentication)