Skip to content
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 response body #62

Open
fthouraud opened this issue Feb 3, 2021 · 4 comments
Open

Wrong type on response body #62

fthouraud opened this issue Feb 3, 2021 · 4 comments

Comments

@fthouraud
Copy link

fthouraud commented Feb 3, 2021

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
Copy link
Contributor

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:

  • parser: 'none' returns a Buffer
  • parser: 'string' returns a string

@ethanent
Copy link
Owner

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

@jdforsythe
Copy link
Contributor

@ethanent I added a PR for this #64

@XuluWarrior
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants