Rewrite the way the DAV header is produced.

This commit is contained in:
Andrew McMillan 2010-06-28 08:39:03 +12:00
parent baa4438c82
commit efd40937fe

View File

@ -29,9 +29,12 @@ require_once('./always.php');
require_once('HTTPAuthSession.php'); require_once('HTTPAuthSession.php');
$session = new HTTPAuthSession(); $session = new HTTPAuthSession();
function send_dav_header() {
global $c;
/** /**
* access-control is rfc3744, we do some of it, but no way to say that. * access-control is rfc3744, we do most of it, but no way to say that.
* calendar-schedule is another one we do some of, but the spec is not final yet either. * calendar-schedule is another one we do most of, but the spec is not final yet either.
*/ */
if ( isset($c->override_dav_header) ) { if ( isset($c->override_dav_header) ) {
$dav = $c->override_dav_header; $dav = $c->override_dav_header;
@ -45,7 +48,12 @@ else {
$dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule'; $dav = '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule';
} }
} }
header( 'DAV: '.$dav); $dav = explode( "\n", wordwrap( $dav ) );
foreach( $dav AS $v ) {
header( 'DAV: '.trim($v, ', '), false);
}
}
send_dav_header(); // Avoid polluting global namespace
require_once('CalDAVRequest.php'); require_once('CalDAVRequest.php');
$request = new CalDAVRequest(); $request = new CalDAVRequest();