Merge pull request #12638 from nextcloud/backport/12556/stable15

[stable15] extend anonymous options to work on every dav url
This commit is contained in:
Morris Jobke 2018-11-26 11:03:12 +01:00 committed by GitHub
commit ca7c56116f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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());
}
}