Fix code scanning alert no. 2: Prototype-polluting assignment
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
@@ -12,10 +12,18 @@ const encoder = new TextEncoder();
|
||||
self.addEventListener("message", async function (event) {
|
||||
if (event.data.close) {
|
||||
let connectionID = event.data.close;
|
||||
if (connectionID === '__proto__' || connectionID === 'constructor' || connectionID === 'prototype') {
|
||||
console.error("Invalid connectionID");
|
||||
return;
|
||||
}
|
||||
delete connections[connectionID];
|
||||
return;
|
||||
} else if (event.data.getMore) {
|
||||
let connectionID = event.data.getMore;
|
||||
if (connectionID === '__proto__' || connectionID === 'constructor' || connectionID === 'prototype') {
|
||||
console.error("Invalid connectionID");
|
||||
return;
|
||||
}
|
||||
let { curOffset, value, reader, intBuffer, byteBuffer } =
|
||||
connections[connectionID];
|
||||
// if we still have some in buffer, then just send it back straight away
|
||||
|
||||
Reference in New Issue
Block a user