Skip to content

Commit a1ddf59

Browse files
committed
fix(dav): do not list intermediate upload folders
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent bcfa3bd commit a1ddf59

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

apps/dav/lib/Upload/RootCollection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(
2626
private IManager $shareManager,
2727
) {
2828
parent::__construct($principalBackend, $principalPrefix);
29+
$this->disableListing = true;
2930
}
3031

3132
/**

apps/dav/lib/Upload/UploadHome.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use OCP\Files\NotFoundException;
1515
use OCP\IUserSession;
1616
use Sabre\DAV\Exception\Forbidden;
17+
use Sabre\DAV\Exception\MethodNotAllowed;
1718
use Sabre\DAV\Exception\NotFound;
1819
use Sabre\DAV\ICollection;
1920

@@ -62,14 +63,7 @@ public function getChild($name): UploadFolder {
6263
}
6364

6465
public function getChildren(): array {
65-
return array_map(function ($node) {
66-
return new UploadFolder(
67-
$node,
68-
$this->cleanupService,
69-
$this->getStorage(),
70-
$this->uid,
71-
);
72-
}, $this->impl()->getChildren());
66+
throw new MethodNotAllowed('Listing members of this collection is disabled');
7367
}
7468

7569
public function childExists($name): bool {

build/integration/filesdrop_features/filesdrop.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Scenario: Files drop allow MKCOL without a nickname
199199
And Downloading public folder "Mallory/folder"
200200
Then the HTTP status code should be "405"
201201
And Downloading public file "Mallory/folder/a.txt"
202-
Then the HTTP status code should be "405"
202+
Then the HTTP status code should be "404"
203203

204204
Scenario: Files drop requires nickname if file request is enabled
205205
Given user "user0" exists

0 commit comments

Comments
 (0)