Skip to content

Commit

Permalink
web: Type SUPPORTED_METHODS so it can be overridden
Browse files Browse the repository at this point in the history
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 tornadoweb#3354 (thanks alexmv and andersk).

Closes tornadoweb#3354
  • Loading branch information
bdarnell committed Jun 7, 2024
1 parent e7dff51 commit 70dc6f7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tornado/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 70dc6f7

Please sign in to comment.