-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixes server ignores request to gzip data #14982
base: develop
Are you sure you want to change the base?
Conversation
api/server/middleware/middleware.go
Outdated
@@ -112,6 +114,40 @@ func AcceptHeaderHandler(serverAcceptedTypes []string) Middleware { | |||
} | |||
} | |||
|
|||
func GzipMiddleware() Middleware { |
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.
Can you rename this to AcceptEncodingHeaderHandler
because we already have AcceptHeaderHandler
?
Hey @rose2221 , thanks for the contribution! This PR only adds gzip to the blobs endpoint, but it would make much more sense to have support on all endpoints that return data. Which means all endpoint that use Before merging the PR you will also have to sign the Contributor License Agreement and add a changelog file. |
Thank you, @rkapka, for your suggestions! I've implemented the requested changes. Let me know if there's anything else that needs adjustment. Also, should I add tests for this as well? |
That would be very helpful. Perhaps you could write a unit test where you:
|
Thank you, I've implemented the test as suggested and I'm open to any further feedback. @rkapka |
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR fixes an issue where the Prysm beacon chain server ignores the
Accept-Encoding: gzip
header in HTTP requests and always returns uncompressed JSON responses.Fix Details:
Accept-Encoding
header.Which issue(s) does this PR fix?
Fixes #14593
Other Notes for Review
Acknowledgements