(conn: Duplex, head: Uint8Array | undefined, signal: AbortSignal)
| 582 | const loadUpgrade = Effect.promise(() => import("./internal/upgrade.ts")) |
| 583 | |
| 584 | const takeOver = (conn: Duplex, head: Uint8Array | undefined, signal: AbortSignal): Duplex => { |
| 585 | if (head !== undefined && head.length > 0) conn.unshift(head) |
| 586 | conn.on("error", constVoid) |
| 587 | if (signal.aborted) { |
| 588 | conn.destroy() |
| 589 | } else { |
| 590 | const onAbort = () => conn.destroy() |
| 591 | signal.addEventListener("abort", onAbort, { once: true }) |
| 592 | conn.once("close", () => signal.removeEventListener("abort", onAbort)) |
| 593 | } |
| 594 | return conn |
| 595 | } |
| 596 | |
| 597 | const upgradeSocket = ( |
| 598 | response: HttpClientResponse, |
no test coverage detected