-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support 'Precondition Required' #102
Comments
Hmm, on second thought, the proposed semantics aren't quite right. It really requires a pair of callbacks
|
First run at this: SebastianEdwards@4faa45b Happy to take a stab at amending the HTTP flowchart if we have consensus on decision node placement. Thoughts? |
Summoning @justinsheehy as he also might have some thoughts regarding the decision tree |
My initial thought would be to put it in the leftmost column with other simple tests, as it seems that it can be determined statically without depending on anything else in the decision flow. A quick reading of the RFC section indicates to me that only the "required" callback is needed. The presence of any conditional request header ("If-*") would satisfy the requirement. I would also support adding this to the original Webmachine if a PR happens to appear there. |
I concur with @justinsheehy, it seems independent of other decisions, so the earlier the better. |
Thanks for the input @justinsheehy. It had occurred to me to use the leftmost column. However, since conditional headers check against existing resources, I thought it made more sense to insert it after it's ascertained that the resource exists. The reasoning for a |
@SebastianEdwards Somewhat off-topic, but can you explain why If-None-Match is useless for conflict avoidance? It seems to me that if two clients are trying to update a resource, checking ETags would ensure nobody writes what they haven't read. |
@samwgoldman an |
For what it's worth, |
Sorry, the other usage of |
Ah, I haven't seen the use of |
@SebastianEdwards Have you made any headway on code/tests for this feature? |
Is there any interest in supporting the
Precondition Required
response in the decision tree? The status code definition can be found at http://tools.ietf.org/html/rfc6585#section-3.The change would add the following:
precondition_required?
which would default tofalse
. This would commonly be used to check for the presence of anIf-Match
header.G7
andG8
which will return code428
if theprecondition_required?
callback returns true.Very happy to prepare a pull request if there is interest in this.
The text was updated successfully, but these errors were encountered: