Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
30ee8b6f
Commit
30ee8b6f
authored
Aug 29, 2014
by
Thomas Müller
Browse files
adding OC-ETag header
parent
2370af62
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/private/connector/sabre/file.php
View file @
30ee8b6f
...
...
@@ -247,8 +247,7 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
* @throws \Sabre\DAV\Exception\NotImplemented
* @throws \Sabre\DAV\Exception\ServiceUnavailable
*/
private
function
createFileChunked
(
$data
)
{
private
function
createFileChunked
(
$data
)
{
list
(
$path
,
$name
)
=
\
Sabre\HTTP\URLUtil
::
splitPath
(
$this
->
path
);
$info
=
\
OC_FileChunking
::
decodeName
(
$name
);
...
...
@@ -305,6 +304,8 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
}
}
// mark chunking complete
$_SERVER
[
'X-CHUNKING_COMPLETE'
]
=
true
;
$info
=
$this
->
fileView
->
getFileInfo
(
$targetPath
);
return
$info
->
getEtag
();
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
...
...
lib/private/connector/sabre/filesplugin.php
View file @
30ee8b6f
...
...
@@ -174,7 +174,24 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
if
(
!
is_null
(
$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
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment