extend anonymous options to work on every dav url

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-11-20 16:02:13 +01:00
parent 75c3737054
commit ffd7778040
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
2 changed files with 2 additions and 2 deletions

View 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

View 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());
}
}