Restrict the OPTIONS response on the root.

This commit is contained in:
Andrew McMillan 2007-11-04 13:48:56 +13:00
parent ee43bf9b9b
commit bdc9c1a875

View File

@ -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");