Skip to content

Commit

Permalink
remove if-range header from the request
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Feb 29, 2020
1 parent 689264e commit 7fd690f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plone/app/caching/operations/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ def interceptResponse(self, rulename, response, class_=None):
self.published, self.request, lastModified=lastModified)

# Remove Range from request if the If-Range condition is not fulfilled
# If-Range check is done here so we could remove the header from request
if_range = self.request.environ.get('HTTP_IF_RANGE', '').strip('"')
if if_range and if_range != lastModified and if_range != etag:
if 'HTTP_RANGE' in self.request.environ:
del self.request.environ['HTTP_RANGE']
if if_range:
if if_range != lastModified and if_range != etag:
if 'HTTP_RANGE' in self.request.environ:
del self.request.environ['HTTP_RANGE']
del self.request.environ['HTTP_IF_RANGE']

# Check for cache stop request variables
Expand Down

0 comments on commit 7fd690f

Please sign in to comment.