mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-08-16 18:00:30 +03:00
filter-pypi-responses: stream package requests that hit the proxy
mitmproxy was buffering all requests (except pythonhosted.*), causing pip to time out when getting big packages from custom URLs. Setting flow.response.stream in the responseheaders hook fixes this.
This commit is contained in:
parent
1f57898e4f
commit
318a87ff55
@ -85,6 +85,11 @@ Response format:
|
||||
"""
|
||||
|
||||
|
||||
def responseheaders(flow: http.HTTPFlow) -> None:
|
||||
if "/simple/" not in flow.request.url:
|
||||
flow.response.stream = True
|
||||
|
||||
|
||||
def response(flow: http.HTTPFlow) -> None:
|
||||
if not "/simple/" in flow.request.url:
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user