コード例 #1
0
 /**
  * HTTP HEAD
  *
  * This method is normally used to take a peak at a url, and only get the HTTP response headers, without the body
  * This is used by clients to determine if a remote file was changed, so they can use a local cached version, instead of downloading it again
  *
  * @param string $uri
  * @return void
  */
 protected function httpHead($uri)
 {
     $node = $this->tree->getNodeForPath($uri);
     /* This information is only collection for File objects.
      * Ideally we want to throw 405 Method Not Allowed for every
      * non-file, but MS Office does not like this
      */
     if ($node instanceof Sabre_DAV_IFile) {
         $headers = $this->getHTTPHeaders($this->getRequestUri());
         if (!isset($headers['Content-Type'])) {
             $headers['Content-Type'] = 'application/octet-stream';
         }
         $this->httpResponse->setHeaders($headers);
     }
     $this->httpResponse->sendStatus(200);
 }