Projects
Wiki     Timeline     Roadmap     Browse Source     View Tickets     New Ticket     Search

Ticket #273 (closed Defect: Cannot reproduce)

Opened 5 years ago

Last modified 5 years ago

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

Reported by: wsanchez@… Owned by: cdaboo@…
Priority: 3: Important Milestone: CalendarServer-1.x
Component: Calendar Server Severity: Other
Keywords: Cc: dreid@…
Port:

Description

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.

Change History

comment:1 Changed 5 years ago by wsanchez@…

  • Priority changed from 2: Expected to 3: Important

comment:2 in reply to: ↑ description Changed 5 years ago by mail@…

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.

comment:3 follow-up: ↓ 4 Changed 5 years ago by cdaboo@…

  • 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...

comment:4 in reply to: ↑ 3 Changed 5 years ago by mail@…

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?

comment:5 follow-up: ↓ 6 Changed 5 years ago by cdaboo@…

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.

comment:6 in reply to: ↑ 5 Changed 5 years ago by mail@…

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.

comment:7 Changed 5 years ago by cdaboo@…

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.

Note: See TracTickets for help on using tickets.