To answer my own question: yes, request.data can be None if the parser 
would correctly parse the incoming body into None, for instance, if the 
body consists of `null` and goes through a JSON parser. 


El martes, 19 de mayo de 2020, 11:40:05 (UTC-4), Lorenzo Peña escribió:
>
> Hola people!
>
> Is there any valid circumstance in which request.data can return None for 
> any request? Checking for whether request.data is None before accessing 
> doesn't seem to be the common practice from the docs. I, however, got an 
> error of this kind as a result of a pentesting. I'm tyring to determine 
> whether I should check if it's None before accessing, or putting a security 
> check in a middleware to specifically raise a concern based on this event 
> happening.
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/0e7510e1-af19-4b7b-9652-dd6189333151%40googlegroups.com.

Reply via email to