]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
tests: httpclient may turn all methods into GET for 303 redirect
authorPierce Lopez <pierce.lopez@gmail.com>
Tue, 22 Sep 2020 17:41:15 +0000 (13:41 -0400)
committerPierce Lopez <pierce.lopez@gmail.com>
Tue, 22 Sep 2020 17:41:15 +0000 (13:41 -0400)
tornado/test/httpclient_test.py

index ca3f4bbd82a71029275a28bb55d183475af5209b..753cfdd2d4125fe239e0b00a6ef3c0c1ea7abd25 100644 (file)
@@ -331,10 +331,14 @@ Transfer-Encoding: chunked
             resp = self.fetch(url, method="POST", body=b"")
             self.assertEqual(b"GET", resp.body)
 
-            # Other methods are left alone.
+            # Other methods are left alone, except for 303 redirect, depending on client
             for method in ["GET", "OPTIONS", "PUT", "DELETE"]:
                 resp = self.fetch(url, method=method, allow_nonstandard_methods=True)
-                self.assertEqual(utf8(method), resp.body)
+                if status in [301, 302]:
+                    self.assertEqual(utf8(method), resp.body)
+                else:
+                    self.assertIn(resp.body, [utf8(method), b"GET"])
+
             # HEAD is different so check it separately.
             resp = self.fetch(url, method="HEAD")
             self.assertEqual(200, resp.code)