Skip to content

Commit

Permalink
Merge pull request #12638 from nextcloud/backport/12556/stable15
Browse files Browse the repository at this point in the history
[stable15] extend anonymous options to work on every dav url
  • Loading branch information
MorrisJobke authored Nov 26, 2018
2 parents d2137ff + 38e115e commit ca7c561
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function initialize(\Sabre\DAV\Server $server) {
* @return bool
*/
public function handleAnonymousOptions(RequestInterface $request, ResponseInterface $response) {
if ($request->getMethod() === 'OPTIONS' && $request->getPath() === '') {
if ($request->getMethod() === 'OPTIONS') {
/** @var CorePlugin $corePlugin */
$corePlugin = $this->server->getPlugin('core');
// setup a fake tree for anonymous access
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/DAV/AnonymousOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testAnonymousOptionsRoot() {
public function testAnonymousOptionsNonRoot() {
$response = $this->sendRequest('OPTIONS', 'foo');

$this->assertEquals(401, $response->getStatus());
$this->assertEquals(200, $response->getStatus());
}
}

Expand Down

0 comments on commit ca7c561

Please sign in to comment.