Skip to content

Commit

Permalink
Merge pull request #8716 from McSinyx/fix-range-request-cache
Browse files Browse the repository at this point in the history
Disable caching for range requests
  • Loading branch information
chrahunt authored Aug 5, 2020
2 parents 3d3c7b6 + ffd6a38 commit f51bd8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Empty file.
6 changes: 4 additions & 2 deletions src/pip/_internal/network/lazy_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def _check_zip(self):
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):
Expand Down

0 comments on commit f51bd8f

Please sign in to comment.