-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dav): Public WebDAV endpoint should allow
GET
requests
`GET` should be allowed even without Ajax header to allow downloading files, or show files in the viewer. All other requests could be guarded, but this should not. Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
9 changed files
with
140 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
Feature: dav-v2-public | ||
Background: | ||
Given using api version "1" | ||
|
||
Scenario: Downloading a file from public share with Ajax header | ||
Given using new dav path | ||
And As an "admin" | ||
And user "user0" exists | ||
And user "user1" exists | ||
And As an "user1" | ||
And user "user1" created a folder "/testshare" | ||
When User "user1" uploads file "data/green-square-256.png" to "/testshare/image.png" | ||
And as "user1" creating a share with | ||
| path | testshare | | ||
| shareType | 3 | | ||
| permissions | 1 | | ||
And As an "user0" | ||
Given using new public dav path | ||
When Downloading public file "/image.png" | ||
Then the downloaded file has the content of "/testshare/image.png" from "user1" data | ||
|
||
# Test that downloading files work to ensure e.g. the viewer works or files can be downloaded | ||
Scenario: Downloading a file from public share without Ajax header and disabled s2s share | ||
Given using new dav path | ||
And As an "admin" | ||
And user "user0" exists | ||
And user "user1" exists | ||
And As an "user1" | ||
And user "user1" created a folder "/testshare" | ||
When User "user1" uploads file "data/green-square-256.png" to "/testshare/image.png" | ||
And as "user1" creating a share with | ||
| path | testshare | | ||
| shareType | 3 | | ||
| permissions | 1 | | ||
And As an "user0" | ||
Given parameter "outgoing_server2server_share_enabled" of app "files_sharing" is set to "no" | ||
Given using new public dav path | ||
When Downloading public file "/image.png" without ajax header | ||
Then the downloaded file has the content of "/testshare/image.png" from "user1" data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
build/integration/features/bootstrap/DavFeatureContext.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
use Behat\Behat\Context\Context; | ||
use Behat\Behat\Context\SnippetAcceptingContext; | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
class DavFeatureContext implements Context, SnippetAcceptingContext { | ||
use AppConfiguration; | ||
use ContactsMenu; | ||
use ExternalStorage; | ||
use Search; | ||
use WebDav; | ||
use Trashbin; | ||
|
||
protected function resetAppConfigs() { | ||
$this->deleteServerConfig('files_sharing', 'outgoing_server2server_share_enabled'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ | |
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
|
||
/** | ||
* Features context. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters