Merge pull request #12808 from nextcloud/fix/12774/anonymous_options_only_anoynoums

Only run the AnonymousOptionsPlugion on Anonymous requests
This commit is contained in:
Roeland Jago Douma 2018-12-04 13:10:22 +01:00 committed by GitHub
commit 43cb51d374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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