Skip to content

Commit

Permalink
default for propfind depth infinity should be false as in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
mrow4a committed Apr 25, 2022
1 parent 294d40d commit 6b9ee22
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getCapabilities() {
'search-files',
],
'propfind' => [
'depth_infinity' => $this->config->getSystemValue('dav.propfind.depth_infinity', true),
'depth_infinity' => $this->config->getSystemValue('dav.propfind.depth_infinity', false),
]
]
];
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/ServerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function createServer(
$server->on('beforeMethod:PROPFIND', function (Request $request) use ($config) {
$depthHeader = strtolower($request->getHeader('depth'));

if ($depthHeader === 'infinity' && !$config->getSystemValue('dav.propfind.depth_infinity', true)) {
if ($depthHeader === 'infinity' && !$config->getSystemValue('dav.propfind.depth_infinity', false)) {
throw new PreconditionFailed('Depth infinity not supported');
}
}, 0);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function __construct(IRequest $request, $baseUri) {
$this->server->on('beforeMethod:PROPFIND', function (Request $request) use ($config) {
$depthHeader = strtolower($request->getHeader('depth'));

if ($depthHeader === 'infinity' && !$config->getSystemValue('dav.propfind.depth_infinity', true)) {
if ($depthHeader === 'infinity' && !$config->getSystemValue('dav.propfind.depth_infinity', false)) {
throw new Exception\PreconditionFailed('Depth infinity not supported');
}
}, 0);
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/40016
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: default for propfind depth infinity adjusted

Fixed potential cause for performance issues under certain conditions
with infinite propfind being enabled by default.

https://github.com/owncloud/core/pull/40016
https://github.com/owncloud/enterprise/issues/5154
4 changes: 2 additions & 2 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1696,11 +1696,11 @@
/**
* Allow propfind depth infinity
*
* With this setting that defaults to true, propfind requests will now be streamed to reduce memory usage
* With this setting enabled propfind requests can be streamed to reduce memory usage
* with large responses. It tells the clients whether `depth=infinity` is allowed for propfind requests.
* For details see: https://datatracker.ietf.org/doc/html/rfc4918#section-10.2
*/
'dav.propfind.depth_infinity' => true,
'dav.propfind.depth_infinity' => false,

/**
* Show the grace period popup
Expand Down

0 comments on commit 6b9ee22

Please sign in to comment.