Ticket #13600: 13600.diff

File 13600.diff, 1.3 KB (added by Chris Beaven, 14 years ago)
  • django/views/static.py

    diff --git a/django/views/static.py b/django/views/static.py
    index d9117f2..475df23 100644
    a b def was_modified_since(header=None, mtime=0, size=0):  
    132132            raise ValueError
    133133        if mtime > header_mtime:
    134134            raise ValueError
    135     except (AttributeError, ValueError):
     135    except (AttributeError, ValueError, OverflowError):
    136136        return True
    137137    return False
  • tests/regressiontests/views/tests/static.py

    diff --git a/tests/regressiontests/views/tests/static.py b/tests/regressiontests/views/tests/static.py
    index d7e87d1..62a9786 100644
    a b class StaticTests(TestCase):  
    2525        file = open(path.join(media_dir, file_name))
    2626        self.assertEquals(file.read(), response.content)
    2727
     28    def test_crazydate(self):
     29        crazy_date = 'Mon, 28 May 999999999999 28:25:26 GMT'
     30        filename = 'file.txt'
     31        response = self.client.get('/views/site_media/%s' % filename,
     32                                   HTTP_IF_MODIFIED_SINCE=crazy_date)
     33        file = open(path.join(media_dir, filename))
     34        self.assertEquals(file.read(), response.content)
     35        self.assertEquals(len(response.content),
     36                          int(response['Content-Length']))
Back to Top