Merge pull request #17601 from owncloud/publicwebdav-allowajaxwhendisabled
Allow ajax requests on public webdav interface
This commit is contained in:
commit
580a961020
1 changed files with 2 additions and 1 deletions
|
@ -46,7 +46,8 @@ $serverFactory = new \OC\Connector\Sabre\ServerFactory(
|
||||||
$requestUri = \OC::$server->getRequest()->getRequestUri();
|
$requestUri = \OC::$server->getRequest()->getRequestUri();
|
||||||
|
|
||||||
$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function () use ($authBackend) {
|
$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function () use ($authBackend) {
|
||||||
if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) {
|
$isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest');
|
||||||
|
if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false && !$isAjax) {
|
||||||
// this is what is thrown when trying to access a non-existing share
|
// this is what is thrown when trying to access a non-existing share
|
||||||
throw new \Sabre\DAV\Exception\NotAuthenticated();
|
throw new \Sabre\DAV\Exception\NotAuthenticated();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue