From: Ben Darnell Date: Fri, 7 Jun 2024 18:51:34 +0000 (-0400) Subject: web: Type SUPPORTED_METHODS so it can be overridden X-Git-Tag: v6.5.0b1~58^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70dc6f73fb9b130e9e548b62b3ff9ff2a8a9e870;p=thirdparty%2Ftornado.git web: Type SUPPORTED_METHODS so it can be overridden 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 --- diff --git a/tornado/web.py b/tornado/web.py index 21d0cad6..207b5ddd 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -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()