rest_framework api view not working when CSRF_HEADER_NAME param is not default #4410
Closed
6 tasks done
Labels
Milestone
Checklist
master
branch of Django REST framework.Steps to reproduce
Set custom CSRF header name in settings.py eg.
setting.py:
Expected behavior
Request should work and data should be modified.
Actual behavior
Systems gives error CSRF Failed: CSRF token missing or incorrect.
Patch
rest_framework/static/rest_framework/js/csrf.js change line 49 to:
rest_framework/templates/rest_framework/base.html add new line between lines 265-266 from:
to
same story in file rest_framework/templates/rest_framework/admin.html but modification should be done between lines 234 and 235
to
rest_framework/renderers.py add new line between 678 and 679 before:
after
and that is all. Last modification have those replaces call because Django documentation say:
ps. great job guys! Nice module.
The text was updated successfully, but these errors were encountered: