Skip to content

Comments

Allow request body in DELETE method#17

Merged
aivus merged 1 commit intoauto1-oss:masterfrom
fpradas:PP-9983-support-delete-body
Oct 8, 2025
Merged

Allow request body in DELETE method#17
aivus merged 1 commit intoauto1-oss:masterfrom
fpradas:PP-9983-support-delete-body

Conversation

@fpradas
Copy link
Contributor

@fpradas fpradas commented Oct 3, 2025

Even if it is not the recommended approach for REST APIs, the HTTP RFC explicitly allows payloads in DELETE requests, even though their semantics are not defined and may be ignored by some servers.

We need this change because one of the internal service endpoints requires a body with DELETE.

Reference: RFC 9110 - Section 9.3.5 DELETE

@fpradas fpradas changed the title PP-9983: Allow request body in DELETE method Allow request body in DELETE method Oct 6, 2025
@aivus aivus merged commit 6aacca6 into auto1-oss:master Oct 8, 2025
15 of 16 checks passed
@Dropaq
Copy link
Contributor

Dropaq commented Oct 13, 2025

@aivus! @diego1auto, did you guys actually look into the RFC referenced above, or just agreed with OP interpretation?

let me:

Although request message framing is independent of the method used, content received in a DELETE request has no generally defined semantics, cannot alter the meaning or target of the request, and might lead some implementations to reject the request and close the connection because of its potential as a request smuggling attack (Section 11.2 of [HTTP/1.1]).

which effectively means, any proxy-server, WAF, etc. will clear the body for you or simply fail the request, and will be absolutely right.

Also, DELETE is deleting whatever is specified in the request, while GET is getting you the same exact thing.
Am I correct to assume you are using GETs with bodies as well?

it's not even about this PR, the approach from your usecase is just wrong.

@aivus
Copy link
Member

aivus commented Oct 14, 2025

Hello @Dropaq

Thank you for your feedback. We have thoroughly reviewed the RFC, and our interpretation differs from yours.

which effectively means, any proxy-server, WAF, etc. will clear the body for you or simply fail the request, and will be absolutely right.

The RFC indicates that there is no standardized approach for handling bodies in DELETE requests, and this behaviour is left to the server’s implementation.

has no generally defined semantics

might lead some implementations to reject the request

Therefore, as a library, our package should not restrict users from including a body in DELETE requests—even if RFC 9110 does not recommend it. This provides users with the flexibility to accommodate various server implementations.

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

Successfully merging this pull request may close these issues.

4 participants