feross / simple-get

Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines
MIT License
401 stars 50 forks source link

Do not `JSON.stringify` a stream body #33

Closed emilbayes closed 7 years ago

emilbayes commented 7 years ago

Allow the use of streams while decoding the response as json

bendrucker commented 7 years ago

Take a look at the test failure please, you'll need to add a truthiness check to either your expression or isStream.

emilbayes commented 7 years ago

Sorry, I was a bit too quick there. Did run tests locally, but should have copy/pasted. You can squash if you're happy as is now :)

emilbayes commented 7 years ago

@bendrucker In this case truthyness is guaranteed by the if (opts.body) :)

bendrucker commented 7 years ago

Oh right just a typo

bendrucker commented 7 years ago

This looks ok to me, I'll wait a bit and see if feross would like to merge or wants a test

emilbayes commented 7 years ago

Great :+1: Very quick turnaround!

emilbayes commented 7 years ago

/cc @feross

feross commented 7 years ago

I added a test in commit https://github.com/feross/simple-get/commit/71646396cb225727bd79ec435ff495b2bb5b33cc and released as 2.6.1.

feross commented 7 years ago

@emilbayes I also added you as a collaborator to this repo.

emilbayes commented 7 years ago

Thank you!