Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ protected function streamNode(Streamer $streamer, NcNode $node, string $rootPath
* It is possible to filter / limit the files that should be downloaded,
* either by passing (multiple) `X-NC-Files: the-file` headers
* or by setting a `files=JSON_ARRAY_OF_FILES` URL query.
*
* @return false|null
*/
public function handleDownload(Request $request, Response $response): ?bool {
public function handleDownload(Request $request, Response $response): ?false {
if ($request->getHeader('X-Sabre-Original-Method') === 'HEAD') {
return null;
}
$node = $this->tree->getNodeForPath($request->getPath());
if (!($node instanceof Directory)) {
// only handle directories
Expand Down Expand Up @@ -183,11 +184,12 @@ public function handleDownload(Request $request, Response $response): ?bool {
}

/**
* Tell sabre/dav not to trigger it's own response sending logic as the handleDownload will have already send the response
*
* @return false|null
* Tell sabre/dav not to trigger its own response sending logic as the handleDownload will have already sent the response
*/
public function afterDownload(Request $request, Response $response): ?bool {
public function afterDownload(Request $request, Response $response): ?false {
if ($request->getHeader('X-Sabre-Original-Method') === 'HEAD') {
return null;
}
$node = $this->tree->getNodeForPath($request->getPath());
if (!($node instanceof Directory)) {
// only handle directories
Expand Down
Loading