Allow compressed metadata in flight#1774
Merged
lukpueh merged 2 commits intotheupdateframework:developfrom Jan 25, 2022
Merged
Conversation
Pull Request Test Coverage Report for Build 1745548324
💛 - Coveralls |
Contributor
|
LGTM |
We never call simple_server with arguments so this is dead code. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
84dd3de to
8340918
Compare
Member
Author
|
Marking non-draft with only these changes:
|
lukpueh
reviewed
Jan 21, 2022
| socketserver.TCPServer.allow_reuse_address = True | ||
|
|
||
| httpd = socketserver.TCPServer(("localhost", 0), handler) | ||
| httpd = socketserver.TCPServer(("localhost", 0), SimpleHTTPRequestHandler) |
Member
There was a problem hiding this comment.
👍 Thanks for cleaning up!
As the comment above says, I introduced this workaround for testing on Windows in Python2 (7dbb30a). So this has become irrelevant quite a while ago.
This commit tries to deal with two interests: * metadata is highly repetitive and compressible: allowing compression would be good * there may be broken web servers (see https://github.com/pypa/pip/blob/404838abcca467648180b358598c597b74d568c9/src/pip/_internal/download.py#L842) that have problems with compression on already compressed target files We can make things better for that first interest while we have no real data for the second interest -- our current workarounds to avoid compression are based on hearsay, not testing. Now that individual fetchers are possible I suggest we simplify ngclient and allow compression. As an example the pip Fetcher could still use the pip response chunking code with all their workarounds -- pip certainly has better capability to maintain a mountain of workarounds and also has endless amounts of real-world testing compared to python-tuf. Details: * Stop modifying Accept-Encoding (Requests default includes gzip) * Don't use response.raw in RequestsFetcher as there is no need: This was a workaround for false "Content-encoding: gzip" inserted by a broken server -- and the workaround was only possible because we knew we never asked for compression * Fix issue in test_session_get_timeout(): it's not mocking the error that requests really raises in this case Fixes theupdateframework#1251 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
8340918 to
b8759a9
Compare
Member
Author
|
modified commit message with an explanation of why we no longer use requests.Response.raw (which is really a urllib3.response.HTTPResponse) |
lukpueh
approved these changes
Jan 25, 2022
This was referenced Jul 19, 2022
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.
from commit description:
Fixes #1251