desmondmorris / node-twitter

Client library for the Twitter REST and Streaming API's.
https://www.npmjs.com/package/twitter
MIT License
1.27k stars 238 forks source link

bug: no response Content-Type checking #91

Open mscdex opened 9 years ago

mscdex commented 9 years ago

Without checking the Content-Type of the HTTP response, exceptions can be thrown when trying to JSON.parse() non-JSON data, for example this response: Unknown URL. See Twitter Streaming API documentation at http://dev.twitter.com/pages/streaming_api.

So either/both Content-Type needs to be checked or/and JSON.parse() should have a try-catch around it and errors handled appropriately.

ibaaj commented 8 years ago

this issue is not solved...