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
1 changed files with 2 additions and 4 deletions

View File

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