]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Test to reproduce 304 on etag mismatch issue
authorJan Dohl <jan@legxaro.de>
Sat, 3 Feb 2018 22:47:47 +0000 (23:47 +0100)
committerJan Dohl <jan@legxaro.de>
Sat, 3 Feb 2018 22:47:47 +0000 (23:47 +0100)
tornado/test/web_test.py

index 646b2f796a20361aaab97f4289e0f3e43672c590..39347deb431971b5e09936640a8eaedad1298c19 100644 (file)
@@ -1081,6 +1081,13 @@ class StaticFileTest(WebTestCase):
             'If-None-Match': response1.headers['Etag']})
         self.assertEqual(response2.code, 304)
 
+    def test_static_304_etag_modified_bug(self):
+        response1 = self.get_and_head("/static/robots.txt")
+        response2 = self.get_and_head("/static/robots.txt", headers={
+            'If-None-Match': '"MISMATCH"',
+            'If-Modified-Since': response1.headers['Last-Modified']})
+        self.assertEqual(response2.code, 200)
+
     def test_static_if_modified_since_pre_epoch(self):
         # On windows, the functions that work with time_t do not accept
         # negative values, and at least one client (processing.js) seems