1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Fix regression in vAPI.warSecret guard code

Related commit:
https://github.com/gorhill/uBlock/commit/bf591d93fb
This commit is contained in:
Raymond Hill 2023-08-14 13:39:27 -04:00
parent 74fa4f9e0e
commit 2a6c1d30b4
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1185,13 +1185,11 @@ vAPI.messaging = {
const guard = details => {
const match = reSecret.exec(details.url);
if ( match === null ) { return; }
if ( match === null ) { return { cancel: true }; }
const secret = match[1];
if ( longSecrets.includes(secret) ) { return; }
const pos = shortSecrets.indexOf(secret);
if ( pos === -1 ) {
return { cancel: true };
}
if ( pos === -1 ) { return { cancel: true }; }
shortSecrets.splice(pos, 1);
};