Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Trying to use the binary protocol with XHRConnection results in a "Bad version in readMessageBegin" error message.
It looks like the response body undergoes a ISO-8859-to-UTF8 conversion before being parsed as bytes.
There is already code for handling ArrayBuffers, but I don't see a way to trigger it.
It seems to work with two changes:
- set xreq.responseType = 'arraybuffer' somewhere in XHRConnection.prototype.flush
- call "self.setRecvBuffer(this.response);" instead of "self.setRecvBuffer(this.responseText);" in the callabck.
I have not tested how this affects the JSONProtocol. If it has to use text, maybe each protocol should provide their media type as defined in THRIFT-3250 so XHRConnection can use the right content type and do any required special case.