-
Notifications
You must be signed in to change notification settings - Fork 120
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
feat(builder-spec): Correctly reject SSZ Accept/Content-Types headers. #678
Conversation
Nice, this looks good. We should do this for |
Co-authored-by: Justin Traglia <[email protected]>
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #678 +/- ##
==========================================
- Coverage 32.57% 30.49% -2.09%
==========================================
Files 42 42
Lines 6972 7015 +43
==========================================
- Hits 2271 2139 -132
- Misses 4412 4602 +190
+ Partials 289 274 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @ryanschneider!
📝 Summary
As outlined in #677 this PR implements "Milestone 1" where we correctly reject SSZ
Accept
andContent-Type
headers.It adds two new helper functions, both of which depend on the new
mimeheader
dependency:RequestAcceptsJSON
returns true if the request either does not include anAccept
header or the header allows JSON response types.NegotiateRequestResponseType
is not yet used, but shows how we can handle accept header parsing in Milestone 2.⛱ Motivation and Context
Begins supporting ethereum/builder-specs#104 by implementing the first milestone in #677.
📚 References
✅ I have run these commands
make lint
make test-race
go mod tidy
CONTRIBUTING.md