diff --git a/htdocs/caldav.php b/htdocs/caldav.php index b0b00770..04697742 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -6,10 +6,76 @@ require_once("BasicAuthSession.php"); $raw_headers = apache_request_headers(); $raw_post = file_get_contents ( 'php://input'); -if ( $debugging && isset($_GET['method']) ) { +if ( isset($debugging) && isset($_GET['method']) ) { $_SERVER['REQUEST_METHOD'] = $_GET['method']; } +/** +* A variety of requests may set the "Depth" header to control recursion +*/ +$query_depth = ( isset($_SERVER['HTTP_DEPTH']) ? $_SERVER['HTTP_DEPTH'] : 0 ); +if ( $query_depth == 'infinite' ) $query_depth = 99; +$query_depth = intval($query_depth); + +/** +* Our path is /