Merge branch 'main' of https://github.com/iml1111/flask into main
This commit is contained in:
commit
d29808c87e
1 changed files with 18 additions and 7 deletions
|
|
@ -1085,16 +1085,27 @@ class Flask(Scaffold):
|
|||
|
||||
# Check HTTP method
|
||||
supported_http_methods = {
|
||||
"GET", "POST", "PUT", "PATCH", "DELETE",
|
||||
"HEAD", "CONNECT", "OPTIONS", "TRACE",
|
||||
"COPY", "LINK", "UNLINK", "PURGE",
|
||||
"LOCK", "UNLOCK", "PROFIND", "VIEW"
|
||||
"GET",
|
||||
"POST",
|
||||
"PUT",
|
||||
"PATCH",
|
||||
"DELETE",
|
||||
"HEAD",
|
||||
"CONNECT",
|
||||
"OPTIONS",
|
||||
"TRACE",
|
||||
"COPY",
|
||||
"LINK",
|
||||
"UNLINK",
|
||||
"PURGE",
|
||||
"LOCK",
|
||||
"UNLOCK",
|
||||
"PROFIND",
|
||||
"VIEW",
|
||||
}
|
||||
for item in methods:
|
||||
if item not in supported_http_methods:
|
||||
raise TypeError(
|
||||
f"'{item}' method is not specified in HTTP."
|
||||
)
|
||||
raise TypeError(f"'{item}' method is not specified in HTTP.")
|
||||
|
||||
rule = self.url_rule_class(rule, methods=methods, **options)
|
||||
rule.provide_automatic_options = provide_automatic_options # type: ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue