bug - undocumented that http_method_names requires lowercase #8118
Replies: 2 comments
-
I believe the faulty comparison may lie here: django-rest-framework/rest_framework/views.py Line 499 in 71e6c30 Where the LHS is lowercased therefore assuming |
Beta Was this translation helpful? Give feedback.
-
I think that using uppercased names for Taking a look here: https://github.com/django/django/blob/main/django/views/generic/base.py#L117 - Django expects to be able to map the name directly onto the counterpart method, when determining which methods to add to the I'm not sure if accepting #8107 would necessarily be a great idea, because I think it'd mean that the REST framework dispatch would then start working if uppercased method names are used in (I think?) |
Beta Was this translation helpful? Give feedback.
-
Works:
Breaks:
The lowercase version shows
Allow: GET, HEAD, OPTIONS
in the browser UI, while leaving SAFE_METHODS as-is with zero other changes brings back"detail": "Method \"GET\" not allowed."
.I have confirmed this is not due to
list
vtuple
, solely due to case.Beta Was this translation helpful? Give feedback.
All reactions