feat(builder-spec): Correctly reject SSZ Accept/Content-Types headers.#678
Merged
Conversation
jtraglia
reviewed
Feb 10, 2025
Collaborator
|
Nice, this looks good. We should do this for |
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
metachris
reviewed
Feb 19, 2025
|
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. |
jtraglia
approved these changes
Feb 19, 2025
jtraglia
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks @ryanschneider!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
As outlined in #677 this PR implements "Milestone 1" where we correctly reject SSZ
AcceptandContent-Typeheaders.It adds two new helper functions, both of which depend on the new
mimeheaderdependency:RequestAcceptsJSONreturns true if the request either does not include anAcceptheader or the header allows JSON response types.NegotiateRequestResponseTypeis 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 lintmake test-racego mod tidyCONTRIBUTING.md