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

DELETE method not being treated as unsafe #280

Closed
sommelon opened this issue Jan 30, 2021 · 3 comments
Closed

DELETE method not being treated as unsafe #280

sommelon opened this issue Jan 30, 2021 · 3 comments

Comments

@sommelon
Copy link

sommelon commented Jan 30, 2021

I am using djoser and I was wondering why isn't the request body of the DELETE method showing up, because it needs the current password in the body. I spent an hour debugging/writing extensions, but nothing worked. Then I stumbled upon this line. Is there a reason the DELETE method is not included there?

@tfranzel
Copy link
Owner

this is one of the few remaining original lines, and i have not really put a lot of thought in it. a quick search has led me to this SO question, where there are quite a few opinions on the topic: https://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request

tl;dr: the HTTP RFC does not explicitly forbid it, Roy Fielding does not like it, OpenAPI 3.0.3 does not allow it.

i tested it and the OpenAPI 3.0.3 spec does indeed not validate anymore. It looks like OpenAPI 3.1.0 will discourage but support it

@sommelon
Copy link
Author

Alright, thanks. The comment above the line is a bit misleading, because DELETE is unsafe. But I don't really know anything about OpenAPI, so maybe that's just me.

@tfranzel
Copy link
Owner

yes that comment is incorrect strictly speaking, but its just wording. i'll close the ticket as there is currently no need to change anything, except for the comment of course.

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

2 participants