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

Implement RFC7232 precedence algorithm for preconditions #637

Closed
wants to merge 1 commit into from
Closed

Implement RFC7232 precedence algorithm for preconditions #637

wants to merge 1 commit into from

Conversation

JessThrysoee
Copy link
Contributor

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.

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.
@avram
Copy link
Contributor

avram commented Apr 1, 2015

I know that there are good reasons here, but this change includes backwards-incompatible changes to the public API of RequestImpl-- is it possible to maintain the existing methods?

@JessThrysoee
Copy link
Contributor Author

Yes I see that incompatibility can be a problem.

This might affect services that sends both ETag and LastModified, but doesn't keep its ETag in sync with its LastModified and expects/rely on LastModified being evaluated even if ETag preconditions succeed.

On the other hand, not implementing rfc7232 may have adverse effect on people considering migrating from a compliant library (e.g. Jersey or CXF). At least some of my tests failed when I substituted Jersey with Resteasy.

@ronsigal
Copy link
Collaborator

ronsigal commented Jul 5, 2015

I haven't looked at the changes yet, but my general principle is that, for non-major releases, new behavior should be optional and should be invoked by a configurable parameter that defaults to "old behavior".

@bedrin
Copy link
Contributor

bedrin commented Mar 12, 2016

I have amended this pull-request and added a configuration parameter to support RFC 7232 compatible preconditions: #754

@ronsigal
Copy link
Collaborator

Hey Jess, Dimitry,

Should I consider this PR to be superseded by #754? I mean, I would definitely want something like the "resteasy.rfc7232preconditions" context parameter. And it looks like both PRs accomplish the same thing. Is there anything in this PR that isn't in #754? I don't think so, but it doesn't hurt to ask.

-Ron

@bedrin
Copy link
Contributor

bedrin commented Mar 26, 2016

@ronsigal that's correct. I have forked this pull-request and made it configurable via context parameter in #754

@ronsigal
Copy link
Collaborator

Thanks, Dimitry.

@liweinan
Copy link
Collaborator

PR754 fixed this.

@liweinan liweinan closed this Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants