equal
deleted
inserted
replaced
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 |