##// END OF EJS Templates
deps: bumped msgpack to latest release and by default use byte only protocol
super-admin -
r1069:e378f012 python3
parent child Browse files
Show More
@@ -17,7 +17,7 b' importlib-metadata==6.0.0'
17 mercurial==6.3.3
17 mercurial==6.3.3
18 mock==5.0.1
18 mock==5.0.1
19 more-itertools==9.1.0
19 more-itertools==9.1.0
20 msgpack-python==0.5.6
20 msgpack==1.0.5
21 orjson==3.8.7
21 orjson==3.8.7
22 psutil==5.9.4
22 psutil==5.9.4
23 py==1.11.0
23 py==1.11.0
@@ -57,7 +57,7 b' class HooksHttpClient(object):'
57 raise
57 raise
58 response = connection.getresponse()
58 response = connection.getresponse()
59 try:
59 try:
60 return msgpack.load(response, raw=False)
60 return msgpack.load(response)
61 except Exception:
61 except Exception:
62 response_data = response.read()
62 response_data = response.read()
63 log.exception('Failed to decode hook response json data. '
63 log.exception('Failed to decode hook response json data. '
@@ -317,7 +317,7 b' class HTTPApplication(object):'
317
317
318 def _vcs_view_params(self, request):
318 def _vcs_view_params(self, request):
319 remote = self._remotes[request.matchdict['backend']]
319 remote = self._remotes[request.matchdict['backend']]
320 payload = msgpack.unpackb(request.body, use_list=True, raw=False)
320 payload = msgpack.unpackb(request.body, use_list=True)
321
321
322 method = payload.get('method')
322 method = payload.get('method')
323 params = payload['params']
323 params = payload['params']
@@ -447,7 +447,7 b' class HTTPApplication(object):'
447
447
448 def status_view(self, request):
448 def status_view(self, request):
449 import vcsserver
449 import vcsserver
450 return {'status': 'OK', 'vcsserver_version': str(vcsserver.__version__),
450 return {'status': 'OK', 'vcsserver_version': safe_str(vcsserver.__version__),
451 'pid': os.getpid()}
451 'pid': os.getpid()}
452
452
453 def service_view(self, request):
453 def service_view(self, request):
@@ -475,7 +475,7 b' class HTTPApplication(object):'
475 resp = {
475 resp = {
476 'id': payload.get('id'),
476 'id': payload.get('id'),
477 'result': dict(
477 'result': dict(
478 version=vcsserver.__version__,
478 version=safe_str(vcsserver.__version__),
479 config=server_config,
479 config=server_config,
480 app_config=app_config,
480 app_config=app_config,
481 environ=environ,
481 environ=environ,
@@ -492,7 +492,8 b' class HTTPApplication(object):'
492 ct = response.content_type
492 ct = response.content_type
493 if ct == response.default_content_type:
493 if ct == response.default_content_type:
494 response.content_type = 'application/x-msgpack'
494 response.content_type = 'application/x-msgpack'
495 return msgpack.packb(value)
495
496 return msgpack.packb(value, use_bin_type=False)
496 return _render
497 return _render
497
498
498 def set_env_from_config(self, environ, config):
499 def set_env_from_config(self, environ, config):
@@ -578,7 +579,7 b' class HTTPApplication(object):'
578 repo_name = environ['HTTP_X_RC_REPO_NAME']
579 repo_name = environ['HTTP_X_RC_REPO_NAME']
579 packed_config = base64.b64decode(
580 packed_config = base64.b64decode(
580 environ['HTTP_X_RC_REPO_CONFIG'])
581 environ['HTTP_X_RC_REPO_CONFIG'])
581 config = msgpack.unpackb(packed_config, raw=False)
582 config = msgpack.unpackb(packed_config)
582
583
583 environ['PATH_INFO'] = environ['HTTP_X_RC_PATH_INFO']
584 environ['PATH_INFO'] = environ['HTTP_X_RC_PATH_INFO']
584 self.set_env_from_config(environ, config)
585 self.set_env_from_config(environ, config)
General Comments 0
You need to be logged in to leave comments. Login now