mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(runtime/http): fix empty blob response (#10689)
This commit is contained in:
parent
8708d3c045
commit
4a9b40b717
2 changed files with 29 additions and 4 deletions
|
@ -132,10 +132,13 @@
|
|||
} else {
|
||||
const reader = innerResp.body.stream.getReader();
|
||||
const r1 = await reader.read();
|
||||
if (r1.done) throw new TypeError("Unreachable");
|
||||
respBody = r1.value;
|
||||
const r2 = await reader.read();
|
||||
if (!r2.done) throw new TypeError("Unreachable");
|
||||
if (r1.done) {
|
||||
respBody = new Uint8Array(0);
|
||||
} else {
|
||||
respBody = r1.value;
|
||||
const r2 = await reader.read();
|
||||
if (!r2.done) throw new TypeError("Unreachable");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
innerResp.body.streamOrStatic.consumed = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue