Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way middleware handles POST requests #27

Open
tim-mccurrach opened this issue Jan 18, 2019 · 0 comments
Open

Change the way middleware handles POST requests #27

tim-mccurrach opened this issue Jan 18, 2019 · 0 comments

Comments

@tim-mccurrach
Copy link
Contributor

At the moment, in the case of a POST request, the middleware only looks in request.POST for the JWT_QUERYSTRING_ARG key. This works well for submitting forms, however Django request.POST is empty when you submit a request with headers: { "Content-Type": "application/json" }. It only fills up when the content-type is normal HTML form submission values (either multipart/form-data or application/x-www-form-urlencoded). In other cases it is necessary to check in request.body.

It might also be useful to look for the JWT_QUERYSTRING_ARG key in request.GET for POST requests as well as GET requests. This will mean the token can be added on the end of a url as a query-string and might simplify the javascript layer in many cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant