]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
web: Type SUPPORTED_METHODS so it can be overridden
authorBen Darnell <ben@bendarnell.com>
Fri, 7 Jun 2024 18:51:34 +0000 (14:51 -0400)
committerBen Darnell <ben@bendarnell.com>
Fri, 7 Jun 2024 18:53:25 +0000 (14:53 -0400)
Its default type is `Tuple[str, str, str, str, str, str, str]`, which
can only be overridden by a tuple of the exact same length.

This change originated in #3354 (thanks alexmv and andersk).

Closes #3354

tornado/web.py

index 21d0cad68978dbeb9028a4d612a4fd68598b4d73..207b5ddd0b7272d5ba042899d7323c2ff14b2077 100644 (file)
@@ -192,7 +192,15 @@ class RequestHandler(object):
 
     """
 
-    SUPPORTED_METHODS = ("GET", "HEAD", "POST", "DELETE", "PATCH", "PUT", "OPTIONS")
+    SUPPORTED_METHODS: Tuple[str, ...] = (
+        "GET",
+        "HEAD",
+        "POST",
+        "DELETE",
+        "PATCH",
+        "PUT",
+        "OPTIONS",
+    )
 
     _template_loaders = {}  # type: Dict[str, template.BaseLoader]
     _template_loader_lock = threading.Lock()