[DAEMON-271] Error streaming object responses to HTTP clients
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2019-02-14T23:16:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 2.0.0 |
Components | appcd-dispatcher |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2019-02-14T21:13:20.000+0000 |
Updated | 2019-02-14T23:16:58.000+0000 |
Description
When a request is made to a service from an HTTP client, such as
curl
, that streams an object response, the dispatcher context's response stream is eventually piped into Koa's HTTP server's response stream which expects streamed chunks to be either strings or buffers. When an object is streamed, an error is thrown.
The solution is to stringify the object before it gets piped to the server response.
https://github.com/appcelerator/appc-daemon/pull/352