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

not possible to pass data as buffer #30

Closed
benkroeger opened this issue Jan 1, 2019 · 1 comment
Closed

not possible to pass data as buffer #30

benkroeger opened this issue Jan 1, 2019 · 1 comment
Labels
Bug Important This is a critical issue

Comments

@benkroeger
Copy link
Contributor

it seems that when passing a Buffer in const options = { data: Buffer.from('foo') }, centra would handle it as json since typeof Buffer resolves to object.
I see two solutions here:

  1. default sendAs to 'raw', which would become a breaking change (since currently 'json' is assumed
  2. add options.buffer and leave options.data as is. When options.buffer is used, call req.body(options.buffer, 'raw')

Thoughts? Happy to provide PR after discussion about suggested options

@ethan7g ethan7g added Bug Important This is a critical issue labels Jan 1, 2019
@ethan7g ethan7g closed this as completed in 18dc597 Jan 1, 2019
@ethan7g
Copy link
Owner

ethan7g commented Jan 1, 2019

Thanks for submitting the issue, @benkroeger!

Patch 3.2.1 has resolved the issue as now buffers are sent in their intended form: as binary data!
This patch is now available on NPM. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Important This is a critical issue
Projects
None yet
Development

No branches or pull requests

2 participants