Skip to content

Commit

Permalink
Merge pull request #5490 from nextcloud/add-clear-site-data-header
Browse files Browse the repository at this point in the history
Add Clear-Site-Data header
  • Loading branch information
LukasReschke committed Jun 29, 2017
2 parents 4a9277d + 2f87fb6 commit 57c5a15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/Controller/LoginController.php
Expand Up @@ -107,7 +107,9 @@ public function logout() {
}
$this->userSession->logout();

return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
$response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
$response->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
return $response;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Core/Controller/LoginControllerTest.php
Expand Up @@ -95,6 +95,7 @@ public function testLogoutWithoutToken() {
->willReturn('/login');

$expected = new RedirectResponse('/login');
$expected->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
$this->assertEquals($expected, $this->loginController->logout());
}

Expand Down Expand Up @@ -124,6 +125,7 @@ public function testLogoutWithToken() {
->willReturn('/login');

$expected = new RedirectResponse('/login');
$expected->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
$this->assertEquals($expected, $this->loginController->logout());
}

Expand Down

0 comments on commit 57c5a15

Please sign in to comment.