fixed last chunk not being decrypted under certain conditions

This commit is contained in:
uh wot 2022-02-27 22:47:15 +01:00
parent ea88be5762
commit 71b9b7f23f
Signed by: uhwot
GPG Key ID: CB2454984587B781
2 changed files with 2 additions and 2 deletions

2
dist/worker.js vendored

File diff suppressed because one or more lines are too long

View File

@ -394,7 +394,7 @@ async function pipeDecryptedStream(writer, body, length, cipher, fixed_range_sta
let chunk = (await reader.readAtLeast(min_bytes, new Uint8Array(2048))).value let chunk = (await reader.readAtLeast(min_bytes, new Uint8Array(2048))).value
if (byte_count % 6144 === 0 && !end) { if (byte_count % 6144 === 0 && min_bytes == 2048) {
// encrypted chunk // encrypted chunk
cipher.decrypt_chunk(chunk) cipher.decrypt_chunk(chunk)
} }