diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 858d8aa1..bdfd0c7b 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -106,9 +106,10 @@ class CalDAVRequest public $ticket; /** - * Whether this request included the 'Brief: T' header. + * An array of values from the 'Prefer' header. At present only 'return-minimal' is acted on in any way - you + * can test that value with the PreferMinimal() method. */ - public $brief_response; + private $prefer; /** * Create a new CalDAVRequest object. @@ -118,8 +119,15 @@ class CalDAVRequest $this->options = $options; if ( !isset($this->options['allow_by_email']) ) $this->options['allow_by_email'] = false; - - $this->brief_response = (isset($_SERVER['HTTP_BRIEF']) && (strtoupper($_SERVER['HTTP_BRIEF']) == 'T')); + + if ( isset($_SERVER['HTTP_PREFER']) ) { + $this->prefer = explode( ',', $_SERVER['HTTP_PREFER']); + } + else if ( isset($_SERVER['HTTP_BRIEF']) && (strtoupper($_SERVER['HTTP_PREFER']) == 'T') ) { + $this->prefer = array( 'return-minimal'); + } + else + $this->prefer = array(); /** * Our path is /