@jonathanleelx/meddle 0.4.1-beta.1 → 0.4.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/update-check.js +6 -1
- package/package.json +1 -1
package/bin/lib/update-check.js
CHANGED
|
@@ -360,11 +360,16 @@ async function downloadBinaryAsset(opts) {
|
|
|
360
360
|
throw lastError || new Error(`download failed for ${assetUrl}`)
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
// Fetch the tiny checksum sidecar and CONSUME its body right away. The
|
|
364
|
+
// sidecar timeout must not span the (potentially multi-minute) payload
|
|
365
|
+
// download — otherwise the sidecar body stream aborts before it is read
|
|
366
|
+
// and the whole install fails with "operation aborted" right after the
|
|
367
|
+
// payload reached 100%.
|
|
363
368
|
const shaResponse = await doFetch(shaUrl, { signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS) })
|
|
364
369
|
if (!shaResponse.ok) throw new Error(`checksum sidecar missing (${shaResponse.status})`)
|
|
370
|
+
const shaText = await shaResponse.text()
|
|
365
371
|
|
|
366
372
|
const payload = await fetchPayload()
|
|
367
|
-
const shaText = await shaResponse.text()
|
|
368
373
|
const expected = shaText.trim().split(/\s+/)[0]
|
|
369
374
|
if (!/^[0-9a-f]{64}$/i.test(expected)) throw new Error(`invalid checksum sidecar`)
|
|
370
375
|
if (sha256Hex(payload) !== expected.toLowerCase()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jonathanleelx/meddle",
|
|
3
|
-
"version": "0.4.1-beta.
|
|
3
|
+
"version": "0.4.1-beta.2",
|
|
4
4
|
"description": "A simple development proxy server with custom routing rules, mock responses, HTTPS interception, and a plugin system",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|