setHeader( 'DAV', ( $version === null ? '1' : $version ) ); } /** * Validates the headers set in this request. * This method validates that all required headers are available and that * all feasible headers for this request have valid values. * * @return void * * @throws ezcWebdavMissingHeaderException * if a required header is missing. * @throws ezcWebdavInvalidHeaderException * if a header is present, but its content does not validate. */ public function validateHeaders() { if ( isset( $this->headers['DAV'] ) === false ) { throw new ezcWebdavMissingHeaderException( 'DAV' ); } $dav = array_map( 'trim', explode( ',', $this->headers['DAV'] ) ); foreach ( $dav as $number ) { if ( $number !== self::VERSION_ONE && $number !== self::VERSION_TWO && $number !== self::VERSION_ONE_EXTENDED ) { throw new ezcWebdavInvalidHeaderException( 'DAV', $this->headers['DAV'], 'Components must be ezcWebdavOptionsResponse::VERSION_ONE, ezcWebdavOptionsResponse::VERSION_TWO or ezcWebdavOptionsResponse::VERSION_ONE_EXTENDED' ); } } // Unified spaces $this->headers['DAV'] = implode( ', ', $dav ); // Validate common HTTP/WebDAV headers parent::validateHeaders(); } } ?>