tornado: Set an explicit SUPPORTED_METHODS.

This commit is contained in:
Alex Vandiver 2023-12-07 18:47:14 +00:00 committed by Tim Abbott
parent 0109658238
commit 875622fe57
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import logging
from contextlib import suppress
from typing import Any, Dict, List, Optional
from typing import Any, Collection, Dict, List, Optional
from urllib.parse import unquote
import tornado.web
@ -83,6 +83,8 @@ def finish_handler(handler_id: int, event_queue_id: str, contents: List[Dict[str
class AsyncDjangoHandler(tornado.web.RequestHandler):
handler_id: int
SUPPORTED_METHODS: Collection[str] = {"GET", "HEAD", "POST", "DELETE"} # type: ignore[assignment] # https://github.com/tornadoweb/tornado/pull/3354
@override
def initialize(self, django_handler: base.BaseHandler) -> None:
self.django_handler = django_handler