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

Refactoring preconditions #319

Merged
merged 3 commits into from Apr 25, 2014
Merged

Refactoring preconditions #319

merged 3 commits into from Apr 25, 2014

Conversation

escowles
Copy link
Contributor

  • Checking date and etag separately, to provide appropriate error messages for clients
  • Folding in cache control headers, so behavior is consistent


if (builder != null) {
throw new WebApplicationException(builder.entity("ETag mismatch").build());
Response.ResponseBuilder builder = request.evaluatePreconditions(roundedDate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something feels really funny about this, but I can't put my finger on it yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the Jersey source code, and it checks the etag first:

https://java.net/projects/jersey/sources/code-1_x/content/jersey-server/src/main/java/com/sun/jersey/spi/container/ContainerRequest.java

I'll take a look at the spec to see if it says anything different, but otherwise I'll change the order of these checks to match the Jersey behavior.

barmintor added a commit that referenced this pull request Apr 25, 2014
@barmintor barmintor merged commit dafc946 into master Apr 25, 2014
@cbeer cbeer deleted the preconditions branch October 17, 2014 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants