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
RESTEASY-1322: RFC 7232 preconditions evaluation #754
RESTEASY-1322: RFC 7232 preconditions evaluation #754
Conversation
RFC7232 Section 6 defines the order of evaluation when more than one precondition is present for a conditional request. Basicaly the algorightm is: compare the tags first, and compare the dates only if the tags are absent.
…edence' into RESTEASY-1322-evaluate-preconditions # Conflicts: # jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/specimpl/RequestImpl.java
…edence' into RESTEASY-1322-evaluate-preconditions # Conflicts: # jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/specimpl/RequestImpl.java
Hi Dimitry, Very nice job. I just have a few minor quibbles.
if (ifModifiedSince != null && (!isRfc7232preconditions() || (isRfc7232preconditions() && !headers.containsKey(IF_NONE_MATCH)))) is equivalent to if (ifModifiedSince != null && (!isRfc7232preconditions() || (!headers.containsKey(IF_NONE_MATCH)))) and if (ifUnmodifiedSince != null && (!isRfc7232preconditions() || (isRfc7232preconditions() && !headers.containsKey(IF_MATCH)))) is equivalent to if (ifUnmodifiedSince != null && (!isRfc7232preconditions() || (!headers.containsKey(IF_MATCH))))
Thank you for all your work. -Ron |
Fixed code style. Documentation still needs to be updated |
…r to Section 3.7. "Configuration Switches"
I have updated the documentation. Ready for review |
Hi Dimitry, Thanks for going that extra step. This PR is ready to merge. -Ron |
RESTEASY-1322: Resteasy processes If-Modified-Since header even when If-None-Match header is present
When both LastModifiedDate and ETag are passed to [evaluatePreconditions(java.util.Date lastModified, EntityTag eTag)](http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/Request.html#evaluatePreconditions%28java.util.Date, javax.ws.rs.core.EntityTag%29) method, RestEasy will return NotModifies status code if any of them match with request headers.
However ETag should have higher priority.
Extract from RFC 7232:
In order to keep backward compatibility this feature is optional and can be enabled using resteasy.rfc7232preconditions configuration property