1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Merge pull request #8716 from McSinyx/fix-range-request-cache

Disable caching for range requests
This commit is contained in:
Chris Hunt 2020-08-05 19:58:22 -04:00 committed by Pradyun Gedam
parent 0ebe453140
commit b9e403b173
No known key found for this signature in database
GPG key ID: FF99710C4332258E
2 changed files with 4 additions and 2 deletions

View file

@ -194,8 +194,10 @@ class LazyZipOverHTTP(object):
def _stream_response(self, start, end, base_headers=HEADERS):
# type: (int, int, Dict[str, str]) -> Response
"""Return HTTP response to a range request from start to end."""
headers = {'Range': 'bytes={}-{}'.format(start, end)}
headers.update(base_headers)
headers = base_headers.copy()
headers['Range'] = 'bytes={}-{}'.format(start, end)
# TODO: Get range requests to be correctly cached
headers['Cache-Control'] = 'no-cache'
return self._session.get(self._url, headers=headers, stream=True)
def _merge(self, start, end, left, right):