Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Don't special-case small Age values
Browse files Browse the repository at this point in the history
Polipo is wrong here, and it's not the only place where it is wrong
(jech/polipo#80).
Pandering to wrong implementations is counter to the idea.
  • Loading branch information
vfaronov committed Jan 30, 2016
1 parent 1847244 commit 5c0293b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
5 changes: 1 addition & 4 deletions httpolice/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ def full_content(self):

@memoized_property
def from_cache(self):
# Some caches (e.g. Polipo) may add an ``Age`` of a few seconds
# even to freshly obtained/validated responses, due to delays.
# To avoid false positives, we use an arbitrary cutoff of 10.
if self.headers.age.is_present and not self.headers.age < 10:
if self.headers.age.is_present:
self.complain(1168)
return True
for warning in self.headers.warning.okay:
Expand Down
15 changes: 0 additions & 15 deletions httpolice/test_data/1168_3

This file was deleted.

0 comments on commit 5c0293b

Please sign in to comment.