THRIFT-4987: Fix TBinaryProtocol support in XHRClient#2157
Conversation
Client: nodejs
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically closed due to inactivity. Thank you for your contributions. |
|
This seems like a valuable change. And while I'm not any expert in JS, it looks sufficiently small to raise at least some trust, i.e. it mostly adds new behavior for the binary use case that was not handled before. The critical change seems to be: Could someone test it, or should me merge it on best trust and wait for user feedback? |
|
Any chance this change could be merged? My team has a use-case that should be done via XHR, but we are needlessly using WebSocket because of this bug. |
- Picking up THRIFT-4987 based on feedback and other PRs and local thrift patches for npm package - Changes most probably originated from apache#2645 and apache#2157 that went stale and PRs were closed
- Picking up THRIFT-4987 based on feedback and other PRs and local thrift patches for npm package - Changes most probably originated from apache#2645 and apache#2157 that went stale and PRs were closed
- Picking up THRIFT-4987 based on feedback and other PRs and local thrift patches for npm package - Changes most probably originated from apache#2645 and apache#2157 that went stale and PRs were closed
Client: nodejs
The XHRClient uses the XMLHttpRequest web api to do requests. To correctly interpret binary data, the
responseTypeneeds to be set toarraybuffer, and theresponseproperty should be used instead ofresponseText(responsedefaults to normal text when not specified). See here.I'd like to add tests but am unsure what the best practice would be for this with regards to the project testing framework? It would involve bundling the
nodejslib into a browser for testing, or perhaps running a headless browser environment in nodejs? I'd be happy to add tests, but would greatly appreciate if someone could point me in the correct direction.I'm succesfully using this fix with a C++ HTTP server using the binary protocol for my use case.
[skip ci]anywhere in the commit message to free up build resources.