webdavdepthsabredav

Allow PROPFIND with Depth: Infinity requests in Sabre/Dav


Many WebDAV servers do not allow PROPFIND requests while sending the Depth: Infinity header (see also this SO question) which would return a description of the whole underlying file system from the specified folder and all subfolders recursively. Instead, they only allow Depth: 0 or Depth: 1 for security reasons which only returns the specified level of the directory tree.

Is it, despite the security issue, possible to turn this feature on in SabreDAV? I found this GitHub issue as well as this changelog from an older version of the software (search for infinity) which both suggest that this has been implemented some time ago.

However, I cannot find any hint how or where to activate it. Does anybody know this?


Solution

  • Yes, it is possible. Call:

    $server->enablePropfindDepthInfinity = true;