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

http: ensure HEAD and GET requests have same headers #3745

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

tonistiigi
Copy link
Member

fixes #3739

Currently, GET requests get Accept-Encoding: gzip added in stdlib, but for HEAD requests, that does not happen https://github.com/golang/go/blob/go1.20.2/src/net/http/transport.go#L2575 . Github server will return different Etag headers based on different request headers(likely handled by separate services), and does not match If-None-Match against Etag from different request.

@jedevc
Copy link
Member

jedevc commented Mar 27, 2023

Would it be worth adding a test for this to compare headers from GET and HEAD (I assume the other headers are similar)?

Ideally, we don't want to have a regression if the stdlib changes behavior and we don't notice the change.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

Added test.

@AkihiroSuda AkihiroSuda merged commit eb3c9d4 into moby:master Mar 28, 2023
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 this pull request may close these issues.

Add an option to cache unchanging URLs in ADD commands
3 participants