wireprotov2: remove support for sending bytes response
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 14 Apr 2018 15:38:11 -0700
changeset 37727 5cdde6158426
parent 37726 0c184ca594bb
child 37728 564a3eec6e63
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
mercurial/wireprotov2server.py
--- 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'],