mercurial/wireprotov2server.py
branchstable
changeset 46404 71443f742886
parent 46066 14ff4929ca8c
child 46819 d4ba4d51f85f
equal deleted inserted replaced
46403:ed0899e01628 46404:71443f742886
    86     # TODO return reasonable responses - not responses that overload the
    86     # TODO return reasonable responses - not responses that overload the
    87     # HTTP status line message for error reporting.
    87     # HTTP status line message for error reporting.
    88     try:
    88     try:
    89         checkperm(rctx, req, b'pull' if permission == b'ro' else b'push')
    89         checkperm(rctx, req, b'pull' if permission == b'ro' else b'push')
    90     except hgwebcommon.ErrorResponse as e:
    90     except hgwebcommon.ErrorResponse as e:
    91         res.status = hgwebcommon.statusmessage(e.code, pycompat.bytestr(e))
    91         res.status = hgwebcommon.statusmessage(
       
    92             e.code, stringutil.forcebytestr(e)
       
    93         )
    92         for k, v in e.headers:
    94         for k, v in e.headers:
    93             res.headers[k] = v
    95             res.headers[k] = v
    94         res.setbodybytes(b'permission denied')
    96         res.setbodybytes(b'permission denied')
    95         return
    97         return
    96 
    98