Skip to content

Commit 4833ca6

Browse files
cmliuCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent e024dbc commit 4833ca6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

_worker.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,10 @@ async function 处理XHTTP请求(request, yourUUID, 反代上下文 = {}) {
596596
await request.body.pipeTo(socket.writable, { signal: abortController.signal });
597597
})();
598598

599-
// 下行:IdentityTransformStream(关键:不是 TransformStream,不耗 CPU)
600-
const 响应流 = new IdentityTransformStream();
599+
// 下行:优先使用 IdentityTransformStream(若运行时不支持则回退到 TransformStream)
600+
const 响应流 = typeof IdentityTransformStream !== 'undefined'
601+
? new IdentityTransformStream()
602+
: new TransformStream();
601603
const 下行Promise = (async () => {
602604
const writer = 响应流.writable.getWriter();
603605
try {

0 commit comments

Comments
 (0)