summaryrefslogtreecommitdiff
path: root/paste/httpheaders.py
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2006-06-26 02:03:39 +0000
committerpjenvey <devnull@localhost>2006-06-26 02:03:39 +0000
commit2e30144d77340b05cc059f2d06c2b79eab3b36c3 (patch)
tree5af06ff1d66c18aba0e43ff77548dd6b2041323b /paste/httpheaders.py
parent1a58c400ad3a218809d5035ee652a9de4f149ea8 (diff)
downloadpaste-2e30144d77340b05cc059f2d06c2b79eab3b36c3.tar.gz
o revised the r5420 patch to be specific to the _IfModifiedSince header
o added a test to reproduce ticket #114
Diffstat (limited to 'paste/httpheaders.py')
-rw-r--r--paste/httpheaders.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/paste/httpheaders.py b/paste/httpheaders.py
index 13fef83..e5bb85a 100644
--- a/paste/httpheaders.py
+++ b/paste/httpheaders.py
@@ -609,10 +609,7 @@ class _DateHeader(_SingleValueHeader):
value = self.__call__(*args, **kwargs)
if value:
try:
- # Split on ';' incase the date header includes extra attributes.
- # E.g. IE 6 is known to send:
- # If-Modified-Since: Sun, 25 Jun 2006 20:36:35 GMT; length=1506
- return mktime_tz(parsedate_tz(value.split(';')[0]))
+ return mktime_tz(parsedate_tz(value))
except TypeError:
raise HTTPBadRequest((
"Received an ill-formed timestamp for %s: %s\r\n") %
@@ -863,6 +860,15 @@ class _IfModifiedSince(_DateHeader):
If-Modified-Since, RFC 2616 section 14.25
"""
version = '1.0'
+
+ def __call__(self, *args, **kwargs):
+ """
+ Split the value on ';' incase the header includes extra attributes. E.g.
+ IE 6 is known to send:
+ If-Modified-Since: Sun, 25 Jun 2006 20:36:35 GMT; length=1506
+ """
+ return _DateHeader.__call__(self, *args, **kwargs).split(';')[0]
+
def parse(self, *args, **kwargs):
value = _DateHeader.parse(self, *args, **kwargs)
if value and value > now():