Show More
@@ -43,7 +43,7 b' def handlewsgirequest(orig, rctx, req, r' | |||
|
43 | 43 | if orig(rctx, req, res, checkperm): |
|
44 | 44 | return True |
|
45 | 45 | |
|
46 | if not rctx.repo.ui.configbool('experimental', 'lfs.serve'): | |
|
46 | if not rctx.repo.ui.configbool(b'experimental', b'lfs.serve'): | |
|
47 | 47 | return False |
|
48 | 48 | |
|
49 | 49 | if not util.safehasattr(rctx.repo.svfs, 'lfslocalblobstore'): |
@@ -54,7 +54,7 b' def handlewsgirequest(orig, rctx, req, r' | |||
|
54 | 54 | |
|
55 | 55 | try: |
|
56 | 56 | if req.dispatchpath == b'.git/info/lfs/objects/batch': |
|
57 | checkperm(rctx, req, 'pull') | |
|
57 | checkperm(rctx, req, b'pull') | |
|
58 | 58 | return _processbatchrequest(rctx.repo, req, res) |
|
59 | 59 | # TODO: reserve and use a path in the proposed http wireprotocol /api/ |
|
60 | 60 | # namespace? |
@@ -81,7 +81,7 b' def _sethttperror(res, code, message=Non' | |||
|
81 | 81 | def _logexception(req): |
|
82 | 82 | """Write information about the current exception to wsgi.errors.""" |
|
83 | 83 | tb = pycompat.sysbytes(traceback.format_exc()) |
|
84 |
errorlog = req.rawenv[ |
|
|
84 | errorlog = req.rawenv[b'wsgi.errors'] | |
|
85 | 85 | |
|
86 | 86 | uri = b'' |
|
87 | 87 | if req.apppath: |
@@ -209,7 +209,7 b' def _batchresponseobjects(req, objects, ' | |||
|
209 | 209 | # verified as the file is streamed to the caller. |
|
210 | 210 | try: |
|
211 | 211 | verifies = store.verify(oid) |
|
212 | if verifies and action == 'upload': | |
|
212 | if verifies and action == b'upload': | |
|
213 | 213 | # The client will skip this upload, but make sure it remains |
|
214 | 214 | # available locally. |
|
215 | 215 | store.linkfromusercache(oid) |
@@ -228,7 +228,7 b' def _batchresponseobjects(req, objects, ' | |||
|
228 | 228 | |
|
229 | 229 | # Items are always listed for downloads. They are dropped for uploads |
|
230 | 230 | # IFF they already exist locally. |
|
231 | if action == 'download': | |
|
231 | if action == b'download': | |
|
232 | 232 | if not exists: |
|
233 | 233 | rsp['error'] = { |
|
234 | 234 | 'code': 404, |
@@ -259,8 +259,8 b' def _batchresponseobjects(req, objects, ' | |||
|
259 | 259 | 'Accept': 'application/vnd.git-lfs' |
|
260 | 260 | } |
|
261 | 261 | |
|
262 | auth = req.headers.get('Authorization', '') | |
|
263 | if auth.startswith('Basic '): | |
|
262 | auth = req.headers.get(b'Authorization', b'') | |
|
263 | if auth.startswith(b'Basic '): | |
|
264 | 264 | hdr['Authorization'] = auth |
|
265 | 265 | |
|
266 | 266 | return hdr |
@@ -297,7 +297,7 b' def _processbasictransfer(repo, req, res' | |||
|
297 | 297 | return True |
|
298 | 298 | |
|
299 | 299 | if method == b'PUT': |
|
300 | checkperm('upload') | |
|
300 | checkperm(b'upload') | |
|
301 | 301 | |
|
302 | 302 | # TODO: verify Content-Type? |
|
303 | 303 | |
@@ -324,7 +324,7 b' def _processbasictransfer(repo, req, res' | |||
|
324 | 324 | |
|
325 | 325 | return True |
|
326 | 326 | elif method == b'GET': |
|
327 | checkperm('pull') | |
|
327 | checkperm(b'pull') | |
|
328 | 328 | |
|
329 | 329 | res.status = hgwebcommon.statusmessage(HTTP_OK) |
|
330 | 330 | res.headers[b'Content-Type'] = b'application/octet-stream' |
General Comments 0
You need to be logged in to leave comments.
Login now