This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send csrf token with file upload requests
- Loading branch information
24dc739
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this doesn't quite fix it, since the csrf middleware in Django checks POST before checking the META. Since we use the raw post data, the middleware errors when accessing POST as a QueryDict.
from https://github.com/django/django/blob/1.2.5/django/middleware/csrf.py#L164
@zalun it seems our use of raw_post_data has been troublesome. In this case, I don't see a way around this without changing how we send the data of the file.