From e7ad2ab06d307c59a9a2f98504542fe474999408 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 27 Jun 2010 19:03:56 +1200 Subject: [PATCH] Switch to 412 precondition failed in line with CardDAV RFC. --- inc/caldav-PUT-default.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/caldav-PUT-default.php b/inc/caldav-PUT-default.php index 536dabb4..973501a2 100644 --- a/inc/caldav-PUT-default.php +++ b/inc/caldav-PUT-default.php @@ -26,10 +26,12 @@ $dest = new DAVResource($request->path); $container = $dest->FetchParentContainer(); if ( $container->IsCalendar() ) { - $request->DoResponse( 409, translate('Incorrect content type for calendar: ') . $request->content_type ); + $request->PreconditionFailed(412,'urn:ietf:params:xml:ns:caldav:supported-calendar-data', + translate('Incorrect content type for calendar: ') . $request->content_type ); } else if ( $container->IsAddressbook() ) { - $request->DoResponse( 409, translate('Incorrect content type for addressbook: ') . $request->content_type ); + $request->PreconditionFailed(412,'urn:ietf:params:xml:ns:carddav:supported-address-data', + translate('Incorrect content type for addressbook: ') . $request->content_type ); } if ( ! $dest->Exists() ) { if ( $container->IsPrincipal() ) {