Exemple #1
0
 /**
  * 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['Lock-Token'])) {
         throw new ezcWebdavMissingHeaderException('Lock-Token');
     }
     // Validate common HTTP/WebDAV headers
     parent::validateHeaders();
 }
Exemple #2
0
 /**
  * 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['Content-Length'])) {
         throw new ezcWebdavMissingHeaderException('Content-Length');
     }
     if (!isset($this->headers['Content-Type'])) {
         $this->setHeader('Content-Type', 'application/octet-stream');
     }
     // Validate common HTTP/WebDAV headers
     parent::validateHeaders();
 }
 /**
  * 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['Destination'])) {
         throw new ezcWebdavMissingHeaderException('Destination');
     }
     if (!isset($this->headers['Overwrite'])) {
         throw new ezcWebdavMissingHeaderException('Overwrite');
     }
     if ($this->headers['Overwrite'] !== 'T' && $this->headers['Overwrite'] !== 'F') {
         throw new ezcWebdavInvalidHeaderException('Overwrite', $this->headers['Overwrite'], "'T' or 'F'");
     }
     if (!isset($this->headers['Depth'])) {
         throw new ezcWebdavMissingHeaderException('Depth');
     }
     if ($this->headers['Depth'] !== ezcWebdavRequest::DEPTH_ZERO && $this->headers['Depth'] !== ezcWebdavRequest::DEPTH_ONE && $this->headers['Depth'] !== ezcWebdavRequest::DEPTH_INFINITY) {
         throw new ezcWebdavInvalidHeaderException('Depth', $this->headers['Depth'], 'ezcWebdavRequest::DEPTH_ZERO, ezcWebdavRequest::DEPTH_ONE or ezcWebdavRequest::DEPTH_INFINITY');
     }
     // Validate common HTTP/WebDAV headers
     parent::validateHeaders();
 }
Exemple #4
0
 /**
  * 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['Destination'])) {
         throw new ezcWebdavMissingHeaderException('Destination');
     }
     if (!isset($this->headers['Overwrite'])) {
         throw new ezcWebdavMissingHeaderException('Overwrite');
     }
     if ($this->headers['Overwrite'] !== 'T' && $this->headers['Overwrite'] !== 'F') {
         throw new ezcWebdavInvalidHeaderException('Overwrite', $this->headers['Overwrite'], "'T' or 'F'");
     }
     // Validate common HTTP/WebDAV headers
     parent::validateHeaders();
 }
Exemple #5
0
 /**
  * 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['Depth'])) {
         throw new ezcWebdavMissingHeaderException('Depth');
     }
     if ($this->headers['Depth'] !== ezcWebdavRequest::DEPTH_ZERO && $this->headers['Depth'] !== ezcWebdavRequest::DEPTH_INFINITY) {
         throw new ezcWebdavInvalidHeaderException('Depth', $this->headers['Depth'], 'ezcWebdavRequest::DEPTH_ZERO or ezcWebdavRequest::DEPTH_INFINITY');
     }
     // Validate common HTTP/WebDAV headers
     parent::validateHeaders();
 }