Add RFC 10008 (QUERY HTTP method) support - #34993
Conversation
f640f86 to
6f9aa37
Compare
|
Will keep this one in draft until the standard is published, but I'd appreciate any review |
258303c to
e7e5a72
Compare
e7e5a72 to
95c6c7a
Compare
95c6c7a to
a723d04
Compare
7c5025d to
6c71421
Compare
|
the draft has been approved for publication, so I'm marking this PR as ready for review. |
That's a 404 now, we can use https://www.rfc-editor.org/info/rfc10008/ instead as a reference. |
|
In which spring boot version will this change be available? |
0a54a98 to
b72dd80
Compare
b72dd80 to
60c1d1b
Compare
e128ddb to
c90b674
Compare
|
Thanks @desiderantes for tackling this. As you can see, touching HTTP method support in Spring can involve quite a few different places. Before we can merge, I'd like to cut the scope down substantially. The core of this change should be about teaching the framework that HTTP QUERY exists and that it carries a request body. Anything else should be considered in later stages. This is a brand new standard; we want to collect developer feedback and see how the industry adopts this before significantly expanding the API surface. I started an inline review but given the many comments, I thought I would summarize my opinion here to make things easier on your side. Focus this PR on the followingPlease keep the following changes:
Please revert the CORS-related changesThe changes you made in The Please revert the caching / conditional-request changesThis PR adds QUERY to various lists of "safe methods". While QUERY is technically a safe method, this isn't what those lists mean. They drive conditional request support in Spring Framework and only look at the actual URL for validation. For QUERY, the request body must be encoded in the caching key when considering conditional requests. This is why QUERY endpoints might want to issue Location headers with a stable URL for a particular resource. This allows clients to send further conditional requests without sending the body again. Supporting conditional requests and caching in general for QUERY methods would require substantial changes. Right now this doesn't make sense since we don't have use cases for this and I'm not aware of QUERY support for CDNs and intermediaries. Please revert the new annotationsNamely Please revert the new DSL and builder shortcut methodsThe use cases are already possible with Other reverts
Last remarksThe changes in |
bclozel
left a comment
There was a problem hiding this comment.
Please apply the suggested changes in my comment above.
|
Hi @bclozel ! Thanks for the review, I've been going through the code fro a while, after all, this PR is a bit old so I had to refresh myself on the changes. I'll address each point:
|
|
Thanks for your feedback.
Fair enough, let's keep that one in then. |
c90b674 to
598e73c
Compare
Signed-off-by: Mario Daniel Ruiz Saavedra <desiderantes93@gmail.com>
598e73c to
2730d77
Compare
|
This is now merged and scheduled for the next milestone. You can use our SNAPSHOTs in the meantime to test things out. Cheers @desiderantes for tackling this. |
This change introduces support for RFC 10008: The HTTP QUERY Method.
Although initially described as just a "safe GET with a body", the QUERY method unlocks the ability to send complex payloads that do not represent a mutation, and can be handled in a safe, idempotent way. Think of it as a replacement for usecases like complex query parameters in URLs, POST requests that do not mutate anything (but have to be treated as such by all other components in the network roundtrip, so no caching, etc.), and non-mutating HTML Form submission that can use an appropriate encoding for the body.
Fixes #32975