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 /
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(
new StrictCookieMissingException()
);
- $expected = new RedirectResponse(\OC::$WEBROOT);
+ $expected = new RedirectResponse(\OC::$WEBROOT . '/');
$this->assertEquals($expected , $response);
}