Skip to content
This repository has been archived by the owner. It is now read-only.

`valid-calendar-object-resource` precondition failure returns with a `403 FORBIDDEN`, should be `412 PRECONDITION FAILED` #220

Closed
macosforgebot opened this issue May 7, 2008 · 7 comments

Comments

@macosforgebot
Copy link

@macosforgebot macosforgebot commented May 7, 2008

@wsanchez originally submitted this as ticket:273

  • Cc: dreid@…

Via David C. R. Reid:

valid-calendar-object-resource precondition failure is sent with a 403 FORBIDDEN status code, which probably should be 412 PRECONDITION FAILED.

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 7, 2008

@wsanchez originally submitted this as comment:1:⁠ticket:273

  • Priority changed from 2: Expected to 3: Important
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 7, 2008

mail@… originally submitted this as comment:2:⁠ticket:273


Replying to wsanchez@apple.com:

Via David C. R. Reid:

valid-calendar-object-resource precondition failure is sent with a 403 FORBIDDEN status code, which probably should be 412 PRECONDITION FAILED.

This seems to be the case for all preconditions relating to a PUT request. The RFC seems to say these errors should generate a 412 as the preconditions have failed to be met.

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 8, 2008

@cyrusdaboo originally submitted this as comment:3:⁠ticket:273

  • Status changed from new to closed
  • Resolution set to worksforme

There are two types of "precondition" being used:

  1. The HTTP If-Match/If-None-Match pre-condition behavior using ETags. An error with one of those should return a 412. I believe it does.

  2. A WebDAV pre-condition/post-condition DAV:error response. Those should return a 403 - again I believe that is working fine. Check the latest WebDAV spec RFC4918 to see how those are used.

The problem here is that the term "precondition" is being used in two different ways.

I am going to mark this as "worksforme" - if you disagree with my analysis go ahead and change it back with an explanation...

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 8, 2008

mail@… originally submitted this as comment:4:⁠ticket:273


Replying to cdaboo@apple.com:

There are two types of "precondition" being used:

  1. The HTTP If-Match/If-None-Match pre-condition behavior using ETags. An error with one of those should return a 412. I believe it does.

  2. A WebDAV pre-condition/post-condition DAV:error response. Those should return a 403 - again I believe that is working fine. Check the latest WebDAV spec RFC4918 to see how those are used. The problem here is that the term "precondition" is being used in two different ways.

I am going to mark this as "worksforme" - if you disagree with my analysis go ahead and change it back with an explanation...

What sections of the RFC's are you looking at?

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 8, 2008

@cyrusdaboo originally submitted this as comment:5:⁠ticket:273


Section 12.1 defines how the 412 code should be used. Note that it says 412 MUST NOT be returned when there are no conditional headers present.

Section 16 talks about the precondition/postcondition behavior. Note that strictly speaking any valid 4xx status code could be used with those, its not just restricted to 403. But for all the CalDAV valid-xxx preconditions, 403 seems the most appropriate. In any case the rules for 412 apply - 412 is only returned when evaluation of the condition request headers indicate an error.

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 8, 2008

mail@… originally submitted this as comment:6:⁠ticket:273


Replying to cdaboo@apple.com:

Section 12.1 defines how the 412 code should be used. Note that it says 412 MUST NOT be returned when there are no conditional headers present.

Section 16 talks about the precondition/postcondition behavior. Note that strictly speaking any valid 4xx status code could be used with those, its not just restricted to 403. But for all the CalDAV valid-xxx preconditions, 403 seems the most appropriate. In any case the rules for 412 apply - 412 is only returned when evaluation of the condition request headers indicate an error.

I saw the 403 when using conditional headers.

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 8, 2008

@cyrusdaboo originally submitted this as comment:7:⁠ticket:273


And was that 403 error the result of a failure caused by the conditional headers? If the conditional header test failed, then it should have been a 412. If the conditional header test passed, but something else failed, then 403 is appropriate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.