Merge pull request #12811 from nextcloud/backport/12808/stable15

[stable15] Only run the AnonymousOptionsPlugion on Anonymous requests
pull/12816/head
Morris Jobke 2018-12-04 13:53:16 +07:00 committed by GitHub
commit fe558f2238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -50,7 +50,7 @@ class AnonymousOptionsPlugin extends ServerPlugin {
* @return bool
*/
public function handleAnonymousOptions(RequestInterface $request, ResponseInterface $response) {
if ($request->getMethod() === 'OPTIONS') {
if ($request->getHeader('Authorization') === null && $request->getMethod() === 'OPTIONS') {
/** @var CorePlugin $corePlugin */
$corePlugin = $this->server->getPlugin('core');
// setup a fake tree for anonymous access