l***@gmail.com
2018-06-11 21:54:42 UTC
Hi there!
I was trying to determine the official order in which 403, 404 and 405
should be returned in the cases where more than one error is applicable.
I asked this failed question in
stackoverflow https://stackoverflow.com/questions/50805614/order-in-which-http-error-codes-403-404-and-405-should-be-expected
and deleted because I
found https://stackoverflow.com/questions/942951/rest-api-error-return-good-practices
. There is an answer, not the accepted one, that explains it really nice.
I am looking at this graphic now: Loading Image...
From it, 403 comes first, then 404 and lastly 405.
I am implementing custom permission class. has_object_permission is
returning 404 before 403 for obvious reasons, the error 404 is raised in
get_object before has_object_permission is even called.
Is this by design?
Can we rethink this and find a way to always call has_object_permission
with obj=None so that 403 is raised before?
I was trying to determine the official order in which 403, 404 and 405
should be returned in the cases where more than one error is applicable.
I asked this failed question in
stackoverflow https://stackoverflow.com/questions/50805614/order-in-which-http-error-codes-403-404-and-405-should-be-expected
and deleted because I
found https://stackoverflow.com/questions/942951/rest-api-error-return-good-practices
. There is an answer, not the accepted one, that explains it really nice.
I am looking at this graphic now: Loading Image...
From it, 403 comes first, then 404 and lastly 405.
I am implementing custom permission class. has_object_permission is
returning 404 before 403 for obvious reasons, the error 404 is raised in
get_object before has_object_permission is even called.
Is this by design?
Can we rethink this and find a way to always call has_object_permission
with obj=None so that 403 is raised before?
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.