Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Do not send Clear-Site-Data to Chrome-like browsers
Clear-Site-Data is broken on Chrome-like browsers.
https://bugs.chromium.org/p/chromium/issues/detail?id=1349087

Signed-off-by: Gaspard d'Hautefeuille <[email protected]>
  • Loading branch information
HLFH authored and solracsf committed Dec 8, 2023
commit 9643cb13ee71a1f44d8e2e985b3b9582ca1fcb46
4 changes: 2 additions & 2 deletions core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/
namespace OC\Core\Controller;

use OC\AppFramework\Http\Request;
use OC\Authentication\Login\Chain;
use OC\Authentication\Login\LoginData;
use OC\Authentication\WebAuthn\Manager as WebAuthnManager;
Expand Down Expand Up @@ -105,8 +106,7 @@ public function logout() {
$this->session->set('clearingExecutionContexts', '1');
$this->session->close();

if ($this->request->getServerProtocol() === 'https') {
// This feature is available only in secure contexts
if (!$this->request->isUserAgent([Request::USER_AGENT_CHROME, Request::USER_AGENT_ANDROID_MOBILE_CHROME])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep both checks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only reverted to the former code that was working for Chrome-like browsers.
I fixed the regression and did not add any minor feature such as the HTTPS check.
This might be best to add the HTTPS check in an additional PR.

$response->addHeader('Clear-Site-Data', '"cache", "storage"');
}

Expand Down