From bdc9c1a8751c58d018c900b9b7a543393bba904a Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 4 Nov 2007 13:48:56 +1300 Subject: [PATCH] Restrict the OPTIONS response on the root. --- inc/caldav-OPTIONS.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/caldav-OPTIONS.php b/inc/caldav-OPTIONS.php index 2f1197ea..3c136714 100644 --- a/inc/caldav-OPTIONS.php +++ b/inc/caldav-OPTIONS.php @@ -11,7 +11,7 @@ dbg_error_log("OPTIONS", "method handler"); if ( ! $request->AllowedTo('read') ) { - $request->DoResponse( 403, translate("You may not access that calendar") ); + $request->DoResponse( 403, translate("You may not access that collection") ); } $exists = false; @@ -55,6 +55,10 @@ if ( isset($c->override_allowed_methods) ) $allowed = $c->override_allowed_methods; else { $allowed = "OPTIONS, GET, HEAD, PUT, DELETE, PROPFIND, MKCOL, MKCALENDAR, LOCK, UNLOCK, REPORT, PROPPATCH"; + if ( $request->path == '/' ) { + $exists = true; + $allowed = "OPTIONS, GET, HEAD, PROPFIND, REPORT"; + } } header( "Allow: $allowed");