mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(middleware): Fix header injection for bruteforce middleware
Calling setHeaders(getHeaders()) breaks the CSP nonce for unknown reasons So shifting back to old standard practise for now Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
e42d82fe13
commit
381c35080d
1 changed files with 1 additions and 5 deletions
|
|
@ -130,11 +130,7 @@ class BruteForceMiddleware extends Middleware {
|
|||
}
|
||||
|
||||
if ($this->delaySlept) {
|
||||
$headers = $response->getHeaders();
|
||||
if (!isset($headers['X-Nextcloud-Bruteforce-Throttled'])) {
|
||||
$headers['X-Nextcloud-Bruteforce-Throttled'] = $this->delaySlept . 'ms';
|
||||
$response->setHeaders($headers);
|
||||
}
|
||||
$response->addHeader('X-Nextcloud-Bruteforce-Throttled', $this->delaySlept . 'ms');
|
||||
}
|
||||
|
||||
return parent::afterController($controller, $methodName, $response);
|
||||
|
|
|
|||
Loading…
Reference in a new issue