aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorHolger Hees <holger.hees@gmail.com>2024-02-14 13:32:21 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-13 09:52:08 +0200
commit73397cd75998c70ccbb5d2cfa87465b88ba23152 (patch)
tree3823f05900e380dcc84705e03978e7a397d77cf2 /lib/private/AppFramework
parent21db61817467169d225af1e4a96bb37f9feaf70e (diff)
downloadnextcloud-server-73397cd75998c70ccbb5d2cfa87465b88ba23152.tar.gz
nextcloud-server-73397cd75998c70ccbb5d2cfa87465b88ba23152.zip
fix: Use `CSP_NONCE` env variable in ContentSecurity Header
We should use 'cspNonceManager' for requesting the NONCE value, because it is doing the same as before, except that it honors a CPS_NONCE environment variable if available. Signed-off-by: Holger Hees <holger.hees@gmail.com>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Middleware/Security/CSPMiddleware.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php b/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php
index 2115c07c0fc..32e9b04cd1e 100644
--- a/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php
@@ -53,7 +53,7 @@ class CSPMiddleware extends Middleware {
$defaultPolicy = $this->contentSecurityPolicyManager->mergePolicies($defaultPolicy, $policy);
if ($this->cspNonceManager->browserSupportsCspV3()) {
- $defaultPolicy->useJsNonce($this->csrfTokenManager->getToken()->getEncryptedValue());
+ $defaultPolicy->useJsNonce($this->cspNonceManager->getNonce());
}
$response->setContentSecurityPolicy($defaultPolicy);