mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(chord): slice 10 http builds without DOM types
This commit is contained in:
parent
b22c5f6941
commit
cc08278a62
3 changed files with 3 additions and 3 deletions
|
|
@ -229,7 +229,7 @@ async function pump(body: ReadableStream<Uint8Array>, res: ServerResponse): Prom
|
|||
const cancel = (): void => void reader.cancel().catch(() => {});
|
||||
res.once("close", cancel);
|
||||
for (;;) {
|
||||
let next: ReadableStreamReadResult<Uint8Array>;
|
||||
let next: Awaited<ReturnType<typeof reader.read>>;
|
||||
try {
|
||||
next = await reader.read();
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ export class WebRequest implements HttpRequest {
|
|||
let read = 0;
|
||||
try {
|
||||
for (;;) {
|
||||
let next: ReadableStreamReadResult<Uint8Array>;
|
||||
let next: Awaited<ReturnType<typeof reader.read>>;
|
||||
try {
|
||||
next = await reader.read();
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ export function webResponse(answer: Answer): Response {
|
|||
// Bodies are bytes over plain `ArrayBuffer`s (never shared memory); the DOM types ask for exactly that.
|
||||
const headers = new Headers();
|
||||
for (const [name, value] of answer.headers.lines()) headers.append(name, value);
|
||||
return new Response(answer.body as BodyInit | null, { status: answer.status, headers });
|
||||
return new Response(answer.body as ConstructorParameters<typeof Response>[0], { status: answer.status, headers });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue