improve comments for no_auto_head option
This commit is contained in:
parent
2971c71fc7
commit
f9452c0114
1 changed files with 4 additions and 3 deletions
|
|
@ -1083,9 +1083,10 @@ class Flask(Scaffold):
|
||||||
rule = self.url_rule_class(rule, methods=methods, **options)
|
rule = self.url_rule_class(rule, methods=methods, **options)
|
||||||
rule.provide_automatic_options = provide_automatic_options # type: ignore
|
rule.provide_automatic_options = provide_automatic_options # type: ignore
|
||||||
|
|
||||||
# If GET is only specified method, Werkzeug automatically adds HEAD method.
|
# When GET is only specified method, Werkzeug automatically adds HEAD method.
|
||||||
# This option will disable that feature to allow the user to write their
|
# If GET is the only user-specified method and the ``no_auto_head`` option
|
||||||
# own handling for HEAD.
|
# is to True, this will disable that feature to allow the user to write their
|
||||||
|
# own handling for HEAD requests.
|
||||||
only_get = methods == {"GET", "OPTIONS"}
|
only_get = methods == {"GET", "OPTIONS"}
|
||||||
|
|
||||||
if only_get and no_auto_head is True:
|
if only_get and no_auto_head is True:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue