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

Add If-Match support and improve If-None-Match wildcard support #24881

Closed
michael-o opened this issue Apr 8, 2020 · 1 comment
Closed

Add If-Match support and improve If-None-Match wildcard support #24881

michael-o opened this issue Apr 8, 2020 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@michael-o
Copy link

michael-o commented Apr 8, 2020

Coming from version 5.2.3.

RFC 7232, section 3.2 says:

If-None-Match can also be used with a value of "*" to prevent an
unsafe request method (e.g., PUT) from inadvertently modifying an
existing representation of the target resource when the client
believes that the resource does not have a current representation
(Section 4.2.1 of [RFC7231]). This is a variation on the "lost
update" problem that might arise if more than one client attempts to
create an initial representation for the target resource.

My understanding is that only value * is allowed, anything else is invalid (400?). Yet, #validateIfNoneMatch(String) does not make a difference between the method types. I cannot also provide a null ETag to denote that the target resource does not exist.

Do I need to handle this manually?

PS: Issue for clarification: httpwg/http-core#356

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 8, 2020
@jhoeller jhoeller added for: team-attention in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jul 19, 2020
@bclozel bclozel self-assigned this Feb 18, 2022
@bclozel bclozel added type: enhancement A general enhancement and removed for: team-attention status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 18, 2022
@bclozel bclozel added this to the 6.0.x milestone Feb 18, 2022
@bclozel bclozel changed the title Uncertainty in org.springframework.web.context.request.ServletWebRequest.checkNotModified(String) Add If-Match support and improve If-None-Match wildcard support Jun 21, 2022
@bclozel
Copy link
Member

bclozel commented Jun 21, 2022

In the meantime, RFC9110 is out and its description of Preconditions shows that we're lacking both If-Match conditions support and specific behavior around wildcards "*" ETags in conditional requests.

Note that we can't really rely on checkNotModified(null) since the compiler can't decide between the ETag String and Last Modified long variants. We should use empty ETags "" to signal that no resource is known on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants