ethanent / phin

Node HTTP client
MIT License
576 stars 33 forks source link

Wrong type on response body #62

Open fthouraud opened 3 years ago

fthouraud commented 3 years ago

Hi 👋

I think there's a problem with either the response body parsing or the type definitions.

Expected

Looking at type definitions, the response body is of type string when we're using parser: 'none'.

Experienced

The body is in fact the Buffer object initialized in centra.

Resolution

I think those type definitions have to be fixed or the buffer has to be consumed to produce a string instead.

I'll be happy to help with a PR once I got your opinion on that.

jdforsythe commented 3 years ago

We have the same issue. I'd vote to just fix the type and leave it as a Buffer (or add an option) as we use it to request PNG files and other things that should be processed as a Buffer and not a string.

Maybe something like:

ethanent commented 3 years ago

Thanks for the suggestion, I agree that seems wrong. A PR would be much appreciated.

jdforsythe commented 3 years ago

@ethanent I added a PR for this https://github.com/ethanent/phin/pull/64

XuluWarrior commented 10 months ago

As #64 is merged does that mean that this issue is fixed?