]> source.dussan.org Git - nextcloud-server.git/commitdiff
extend anonymous options to work on every dav url 12638/head
authorRobin Appelman <robin@icewind.nl>
Tue, 20 Nov 2018 15:02:13 +0000 (16:02 +0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Fri, 23 Nov 2018 18:05:03 +0000 (18:05 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php
apps/dav/tests/unit/DAV/AnonymousOptionsTest.php

index 7a62f706378f0217efe9a6c89479ab071dbd91b9..b69c1e0286cfef548352a4df9b4e0426ed13fe60 100644 (file)
@@ -50,7 +50,7 @@ class AnonymousOptionsPlugin extends ServerPlugin {
         * @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
index 4e440e6644b388a945d466a8b0f3c3521d03cba1..87a778e596deb0c2dc89b3eebf7a5da789735139 100644 (file)
@@ -54,7 +54,7 @@ class AnonymousOptionsTest extends TestCase {
        public function testAnonymousOptionsNonRoot() {
                $response = $this->sendRequest('OPTIONS', 'foo');
 
-               $this->assertEquals(401, $response->getStatus());
+               $this->assertEquals(200, $response->getStatus());
        }
 }