updated itty-router, updated compatibility date, switched to yarn, fixed corruptions
This commit is contained in:
parent
84cf6e9e4c
commit
101394e22d
File diff suppressed because one or more lines are too long
7
index.js
7
index.js
|
@ -424,12 +424,11 @@ async function pipeDecryptedStream(writer, body, length, cipher, fixed_range_sta
|
||||||
const reader = body.getReader({ mode: 'byob' })
|
const reader = body.getReader({ mode: 'byob' })
|
||||||
let byte_count = fixed_range_start
|
let byte_count = fixed_range_start
|
||||||
|
|
||||||
let buffer = new Uint8Array(2048)
|
|
||||||
let end = false
|
let end = false
|
||||||
while (!end) {
|
while (!end) {
|
||||||
end = byte_count + 2048 >= length
|
end = byte_count + 2048 >= length
|
||||||
|
|
||||||
let chunk = (await reader.readAtLeast(2048, buffer)).value
|
let chunk = (await reader.readAtLeast(2048, new Uint8Array(2048))).value
|
||||||
|
|
||||||
if (byte_count % 6144 === 0 && chunk.byteLength == 2048) {
|
if (byte_count % 6144 === 0 && chunk.byteLength == 2048) {
|
||||||
// encrypted chunk
|
// encrypted chunk
|
||||||
|
@ -445,11 +444,7 @@ async function pipeDecryptedStream(writer, body, length, cipher, fixed_range_sta
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.write(chunk)
|
writer.write(chunk)
|
||||||
|
|
||||||
if (!end) {
|
|
||||||
byte_count += 2048
|
byte_count += 2048
|
||||||
buffer = new Uint8Array(chunk.buffer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.close()
|
writer.close()
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"browser-id3-writer": "^4.4.0",
|
"browser-id3-writer": "^4.4.0",
|
||||||
"itty-router": "^2.4.10",
|
"itty-router": "^2.5.2",
|
||||||
"serverless-cloudflare-workers": "^1.2.0"
|
"serverless-cloudflare-workers": "^1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ workers_dev = true
|
||||||
kv_namespaces = [
|
kv_namespaces = [
|
||||||
{ binding = "KV", id = "974c0967a84e415daa054bbbcc7f80c6", preview_id = "cfcc6491f3484cbca664913836635113" }
|
{ binding = "KV", id = "974c0967a84e415daa054bbbcc7f80c6", preview_id = "cfcc6491f3484cbca664913836635113" }
|
||||||
]
|
]
|
||||||
compatibility_date = "2022-02-27"
|
compatibility_date = "2022-03-09"
|
||||||
|
|
||||||
# [secrets]
|
# [secrets]
|
||||||
# ARL
|
# ARL
|
Loading…
Reference in New Issue