-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong type on buffer response #149
Comments
Looks like this can be closed now as #150 has been merged. |
Crap, in reality this shouldn't be a stream. Docker-modem only returns a stream if the isStream is specified. I missed this. The logs example work. Did you change the "follow" parameter to false? |
If JSON parsing fails we should just return the string, instead of the buffer though. |
I am trying to make the log examples and they do not work and send the following error:
stream.on('data', processData); ^ TypeError: stream.on is not a function at Modem.demuxStream (/workspace/1_Project/1_Sources/node_modules/docker-modem/lib/modem.js:410:10)
Because the returned stream is of type Buffer and not of type ReadableStream, I think the bug is in this line:
docker-modem/lib/modem.js
Line 300 in 52ae729
Which should be:
var json = utils.parseJSON(result) || Readable.from(buffer);
I will send a pull request with the change please review it.
The text was updated successfully, but these errors were encountered: