Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Add get/set-IfUnmodifiedSince, get/set-IfMatch methods on HttpHeaders [SPR-14228] #18802
For a conditional PUT request I would like to use the If-Match header, however there is no corresponding get method on HttpHeaders. Similarly, there is no method for If-Unmodified-Since. The methods do exist for the If-None-Match and If-Modified since headers.
The methods are easy to add and quite useful for optimistic concurrency control on REST services.
For now there is a simple workaround for the missing If-Unmodified-Since method since the getFirstDate(String header) method is public, but it's a bit uglier for the If-Match header since the corresponding getFirstHeaderAsList(String header) method is protected.
Referenced from: commits 55dae61