-
Notifications
You must be signed in to change notification settings - Fork 285
Allow compressed metadata in flight #1774
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
Allow compressed metadata in flight #1774
Conversation
Pull Request Test Coverage Report for Build 1745548324
💛 - Coveralls |
|
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
|
Marking non-draft with only these changes:
|
| socketserver.TCPServer.allow_reuse_address = True | ||
|
|
||
| httpd = socketserver.TCPServer(("localhost", 0), handler) | ||
| httpd = socketserver.TCPServer(("localhost", 0), SimpleHTTPRequestHandler) |
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.
👍 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
|
modified commit message with an explanation of why we no longer use requests.Response.raw (which is really a urllib3.response.HTTPResponse) |
from commit description:
Fixes #1251