Return an honest set of OPTIONS in the normal case, and allow us to override

so we can see if clients will try and use the ones we don't support.
This commit is contained in:
Andrew McMillan 2006-12-02 00:08:42 +13:00
parent 3459bff7df
commit d3a71cd234

View File

@ -47,14 +47,17 @@ if ( !exists ) {
/** /**
* As yet we only support quite a limited range of options. When we see clients looking * As yet we only support quite a limited range of options. When we see clients looking
* for more than this we will work to support them further. We should probably support * for more than this we will work to support them further. So we can see clients trying
* PROPPATCH, because I suspect that will be used. Also HEAD and POST being fairly standard * to use such methods there is a configuration option to override and allow lying about
* should be handled. COPY and MOVE would seem to be easy also. * what is available.
*/ */
$allowed = "OPTIONS, GET, PUT, DELETE, PROPFIND, PROPPATCH, MKCOL, MKCALENDAR"; if ( isset($c->override_allowed_methods) )
if ( $is_calendar ) $allowed .= ", REPORT"; $allowed = $c->override_allowed_methods;
else {
$allowed = "OPTIONS, GET, HEAD, PUT, DELETE, PROPFIND, MKCOL, MKCALENDAR";
if ( $is_calendar ) $allowed .= ", REPORT";
}
header( "Allow: $allowed"); header( "Allow: $allowed");
// header( "Allow: ACL, COPY, DELETE, GET, HEAD, LOCK, MKCALENDAR, MKCOL, MOVE, OPTIONS, POST, PROPFIND, PROPPATCH, PUT, REPORT, SCHEDULE, TRACE, UNLOCK");
/** /**
* From reading the "Scheduling Extensions to CalDAV" draft I don't think that we will * From reading the "Scheduling Extensions to CalDAV" draft I don't think that we will