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

Support qvalue weighting in Accept headers #165

Closed
nflaig opened this issue May 13, 2024 · 0 comments · Fixed by #167
Closed

Support qvalue weighting in Accept headers #165

nflaig opened this issue May 13, 2024 · 0 comments · Fixed by #167
Assignees

Comments

@nflaig
Copy link

nflaig commented May 13, 2024

At the moment, Checkpointz does not support q-factor weighting in Accept header values.

E.g. if a client sends a header like this

Accept: application/octet-stream;q=1,application/json;q=0.9

Checkpointz should handle this as prefer sending ssz response and if not suppored fall back to json and if that is not supported as well it should return a 406 status code.

The current behavior is that it assumes the client requested json data and it results in the following response for getStateV2

unsupported content-type: application/json

And it returns a 415 status code (406 would be more correct).

Ideally, should follow RFC-9110 for Accept header handling.

We have a bunch of test cases in Lodestar which might help to test the implementation, see acceptHeader.test.ts

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

Successfully merging a pull request may close this issue.

2 participants