Skip to content
Snippets Groups Projects
Unverified Commit e70249e0 authored by Holger Hees's avatar Holger Hees Committed by Morris Jobke
Browse files

Update SecurityMiddleware.php

OC::$WEBROOT can be empty in case if your nextcloud installation has no url prefix. This will result in an empty Location Header.

in other areas OC::$WEBROOT is always used together with an /
parent b2959d7c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment