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

Assuming all JSON payloads are application/json is wrong #70

Open
inadarei opened this issue Jul 24, 2018 · 1 comment
Open

Assuming all JSON payloads are application/json is wrong #70

inadarei opened this issue Jul 24, 2018 · 1 comment

Comments

@inadarei
Copy link

inadarei commented Jul 24, 2018

This is regarding: https://github.com/mikeal/r2/blob/master/index.js#L73

If current code sees that you are passing json it overrides content-type header to be set to application/json. But application/json is not the only JSON media type. There're plenty of others:

  1. HAL http://stateless.co/hal_specification.html
  2. JSON API http://jsonapi.org/
  3. Siren https://github.com/kevinswiber/siren
  4. Hyper http://hyperjson.io/

to name just a few

@bcomnes
Copy link

bcomnes commented Aug 14, 2018

Probably just make the opts.headers override this.

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

No branches or pull requests

2 participants