#35062: Update csrf.py to check request.POST if request.method is not GET
---------------------------------------+------------------------
               Reporter:  petermjones  |          Owner:  nobody
                   Type:  Bug          |         Status:  new
              Component:  CSRF         |        Version:  4.2
               Severity:  Normal       |       Keywords:
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  1
                  UI/UX:  0            |
---------------------------------------+------------------------
 When trying to determine request_csrf_token within csrf.py, request.method
 == "POST" fails (CSRF token missing) if you use custom middle ware that
 handles a form field _method to convert request.method to PUT/DELETE...
 etc. I use this middle ware since HTML forms can only use GET and POST,
 and I want my page to work even when JavaScript is disabled.

 Change django/middleware/csrf.py (line 365)
         if request.method == "POST":

 To
         if request.method != "GET":

-- 
Ticket URL: <https://code.djangoproject.com/ticket/35062>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018c9f51392f-be5970c5-e80f-49c0-83a0-148d257fe47a-000000%40eu-central-1.amazonses.com.

Reply via email to