Merge pull request #18867 from HolgerHees/patch-1

Update SecurityMiddleware.php
This commit is contained in:
Morris Jobke 2020-07-06 22:31:48 +02:00 committed by GitHub
commit 2124d1914a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ class SecurityMiddleware extends Middleware {
public function afterException($controller, $methodName, \Exception $exception): Response { public function afterException($controller, $methodName, \Exception $exception): Response {
if ($exception instanceof SecurityException) { if ($exception instanceof SecurityException) {
if ($exception instanceof StrictCookieMissingException) { if ($exception instanceof StrictCookieMissingException) {
return new RedirectResponse(\OC::$WEBROOT); return new RedirectResponse(\OC::$WEBROOT . '/');
} }
if (stripos($this->request->getHeader('Accept'),'html') === false) { if (stripos($this->request->getHeader('Accept'),'html') === false) {
$response = new JSONResponse( $response = new JSONResponse(

View File

@ -535,7 +535,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
new StrictCookieMissingException() new StrictCookieMissingException()
); );
$expected = new RedirectResponse(\OC::$WEBROOT); $expected = new RedirectResponse(\OC::$WEBROOT . '/');
$this->assertEquals($expected , $response); $this->assertEquals($expected , $response);
} }