From 6da047af1e2d890e42fb59b38d47cb460917688b Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 22 May 2025 13:18:43 +0200 Subject: [PATCH] Issue #2736 - Follow-up: Remove erroneous workerthread CSP check. In `OnStreamCompleteInternal` an incorrect workerthread CSP enabled check was added. This was a duplicate check and this is actually on the main thread so asserts the wrong thread for a `WorkerPref`. --- dom/workers/ScriptLoader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 5dc4038be5..e45301c1d9 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -1246,9 +1246,8 @@ private: // We did inherit CSP in bug 1223647. If we do not already have a CSP, we // should get it from the HTTP headers on the worker script. - if (mWorkerPrivate->CSPEnabled() && - !mWorkerPrivate->GetCSP() && - CSPService::sCSPEnabled) { + if (CSPService::sCSPEnabled && + !mWorkerPrivate->GetCSP()) { rv = mWorkerPrivate->SetCSPFromHeaderValues(tCspHeaderValue, tCspROHeaderValue); NS_ENSURE_SUCCESS(rv, rv);