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: https://github.com/httpwg/http-core/issues/356
Comment From: bclozel
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.