Merge pull request #21144 from owncloud/dav-auth-checkduplicateheader
Properly check X-Requested-With header in case of multiple values
This commit is contained in:
commit
f799b27f0e
|
@ -160,7 +160,7 @@ class Auth extends AbstractBasic {
|
||||||
return [true, $this->principalPrefix . $user];
|
return [true, $this->principalPrefix . $user];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->userSession->isLoggedIn() && $request->getHeader('X-Requested-With') === 'XMLHttpRequest') {
|
if (!$this->userSession->isLoggedIn() && in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With')))) {
|
||||||
// do not re-authenticate over ajax, use dummy auth name to prevent browser popup
|
// do not re-authenticate over ajax, use dummy auth name to prevent browser popup
|
||||||
$response->addHeader('WWW-Authenticate','DummyBasic realm="' . $this->realm . '"');
|
$response->addHeader('WWW-Authenticate','DummyBasic realm="' . $this->realm . '"');
|
||||||
$response->setStatus(401);
|
$response->setStatus(401);
|
||||||
|
|
Loading…
Reference in New Issue