Merge pull request #5490 from nextcloud/add-clear-site-data-header

Add Clear-Site-Data header
This commit is contained in:
Lukas Reschke 2017-06-29 13:32:46 +02:00 committed by GitHub
commit 57c5a15e41
2 changed files with 5 additions and 1 deletions

View File

@ -107,7 +107,9 @@ class LoginController extends Controller {
} }
$this->userSession->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;
} }
/** /**

View File

@ -95,6 +95,7 @@ class LoginControllerTest extends TestCase {
->willReturn('/login'); ->willReturn('/login');
$expected = new RedirectResponse('/login'); $expected = new RedirectResponse('/login');
$expected->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
$this->assertEquals($expected, $this->loginController->logout()); $this->assertEquals($expected, $this->loginController->logout());
} }
@ -124,6 +125,7 @@ class LoginControllerTest extends TestCase {
->willReturn('/login'); ->willReturn('/login');
$expected = new RedirectResponse('/login'); $expected = new RedirectResponse('/login');
$expected->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
$this->assertEquals($expected, $this->loginController->logout()); $this->assertEquals($expected, $this->loginController->logout());
} }