From 5c0293b9b2fb2a6955968c1c1a96e8bfc3d76e05 Mon Sep 17 00:00:00 2001 From: Vasiliy Faronov Date: Sat, 30 Jan 2016 20:19:58 +0300 Subject: [PATCH] Don't special-case small Age values Polipo is wrong here, and it's not the only place where it is wrong (https://github.com/jech/polipo/issues/80). Pandering to wrong implementations is counter to the idea. --- httpolice/response.py | 5 +---- httpolice/test_data/1168_3 | 15 --------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 httpolice/test_data/1168_3 diff --git a/httpolice/response.py b/httpolice/response.py index 7a2bbc9..9897ef5 100644 --- a/httpolice/response.py +++ b/httpolice/response.py @@ -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: diff --git a/httpolice/test_data/1168_3 b/httpolice/test_data/1168_3 deleted file mode 100644 index 952de16..0000000 --- a/httpolice/test_data/1168_3 +++ /dev/null @@ -1,15 +0,0 @@ - - -======== BEGIN INBOUND STREAM ======== -GET / HTTP/1.1 -Host: example.com -User-Agent: demo - -======== BEGIN OUTBOUND STREAM ======== -HTTP/1.1 200 OK -Date: Thu, 31 Dec 2015 18:26:56 GMT -Content-Type: text/plain -Content-Length: 14 -Age: 4 - -Hello world!