changeset 37727:5cdde6158426

wireprotov2: remove support for sending bytes response We recently declared that all responses must be CBOR. So remove support for sending a type that isn't CBOR data. Differential Revision: https://phab.mercurial-scm.org/D3387
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 14 Apr 2018 15:38:11 -0700
parents 0c184ca594bb
children 564a3eec6e63
files mercurial/wireprotov2server.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireprotov2server.py	Sat Apr 14 15:36:12 2018 -0700
+++ b/mercurial/wireprotov2server.py	Sat Apr 14 15:38:11 2018 -0700
@@ -301,11 +301,7 @@
     res.status = b'200 OK'
     res.headers[b'Content-Type'] = FRAMINGTYPE
 
-    if isinstance(rsp, wireprototypes.bytesresponse):
-        action, meta = reactor.oncommandresponseready(outstream,
-                                                     command['requestid'],
-                                                     rsp.data)
-    elif isinstance(rsp, wireprototypes.cborresponse):
+    if isinstance(rsp, wireprototypes.cborresponse):
         encoded = cbor.dumps(rsp.value, canonical=True)
         action, meta = reactor.oncommandresponseready(outstream,
                                                       command['requestid'],