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

structured-headers: Has JSON been considered? #538

Closed
evert opened this issue Mar 28, 2018 · 2 comments
Closed

structured-headers: Has JSON been considered? #538

evert opened this issue Mar 28, 2018 · 2 comments

Comments

@evert
Copy link
Contributor

evert commented Mar 28, 2018

This is a question I got after publishing a first stab at an implementation. Was JSON considered as an alternative for this?

At least some reasons why I can think of why it wouldn't be good are:

  • It doesn't encode binary data
  • It's not as aesthetically pleasing, especially considering how HTTP headers generally 'look'.

However, parsers are everywhere and JSON has some properties that structured-headers doesn't have, such as deeper nesting, encoding null and it also solves #534

@mnot
Copy link
Member

mnot commented Mar 28, 2018

Yes - there's a long history behind that, and we originally had a JSON-based approach.

Besides the reason you mention, there was a lot of discomfort around the imprecision of numbers in JSON, and also about enabling arbitrary nesting of data structures.

@mnot mnot closed this as completed Mar 28, 2018
@evert
Copy link
Contributor Author

evert commented Mar 28, 2018

Thanks for the feedback. I'm gonna try to dig into the discussions

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

No branches or pull requests

2 participants