parent
daceb1a9ac
commit
a84ade5f32
|
@ -247,7 +247,8 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
|
||||||
* @throws \Sabre\DAV\Exception\NotImplemented
|
* @throws \Sabre\DAV\Exception\NotImplemented
|
||||||
* @throws \Sabre\DAV\Exception\ServiceUnavailable
|
* @throws \Sabre\DAV\Exception\ServiceUnavailable
|
||||||
*/
|
*/
|
||||||
private function createFileChunked($data) {
|
private function createFileChunked($data)
|
||||||
|
{
|
||||||
list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($this->path);
|
list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($this->path);
|
||||||
|
|
||||||
$info = \OC_FileChunking::decodeName($name);
|
$info = \OC_FileChunking::decodeName($name);
|
||||||
|
@ -304,8 +305,6 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark chunking complete
|
|
||||||
$_SERVER['X-CHUNKING_COMPLETE'] = true;
|
|
||||||
$info = $this->fileView->getFileInfo($targetPath);
|
$info = $this->fileView->getFileInfo($targetPath);
|
||||||
return $info->getEtag();
|
return $info->getEtag();
|
||||||
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
||||||
|
|
|
@ -174,24 +174,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
|
||||||
if (!is_null($fileId)) {
|
if (!is_null($fileId)) {
|
||||||
$this->server->httpResponse->setHeader('OC-FileId', $fileId);
|
$this->server->httpResponse->setHeader('OC-FileId', $fileId);
|
||||||
}
|
}
|
||||||
$eTag = $this->getETag($node);
|
|
||||||
if (!is_null($eTag)) {
|
|
||||||
$this->server->httpResponse->setHeader('OC-ETag', $eTag);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param \OC\Connector\Sabre\Node $node
|
|
||||||
*/
|
|
||||||
private function getETag($node) {
|
|
||||||
if (isset($_SERVER['HTTP_OC_CHUNKED'])) {
|
|
||||||
if (isset($_SERVER['X-CHUNKING_COMPLETE'])) {
|
|
||||||
return $node->getETag();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return $node->getETag();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue