Merge pull request #18867 from HolgerHees/patch-1

Update SecurityMiddleware.php
pull/21728/head
Morris Jobke 4 years ago committed by GitHub
commit 2124d1914a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
  2. 2
      tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php

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

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

Loading…
Cancel
Save