From ba67df4d1f7014f1f1a839f64f15e84dacf67f96 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 14 Jun 2009 21:20:15 +1200 Subject: [PATCH] More reasonable test for early 404. --- htdocs/caldav.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/caldav.php b/htdocs/caldav.php index 4d9aa18d..fe051c97 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -33,9 +33,11 @@ header( "DAV: $dav"); require_once("CalDAVRequest.php"); $request = new CalDAVRequest(); -if ( ! isset($request->collection) ) { +if ( ! ($request->IsPrincipal() || isset($request->collection) || $request->method == 'PUT' || $request->method == 'MKCALENDAR' || $request->method == 'MKCOL' ) ) { dbg_error_log( "LOG WARNING", "Attempt to %s url '%s' but no collection exists there.", $request->method, $request->path ); -// $request->DoResponse( 404, translate("There is no collection at that URL.") ); + if ( $request->method == 'GET' || $request->method == 'REPORT' ) { + $request->DoResponse( 404, translate("There is no collection at that URL.") ); + } } switch ( $request->method ) {