fix(desktop): adapt host fetch handlers

This commit is contained in:
07akioni
2026-09-04 16:29:01 +08:00
parent 75c7bbb88d
commit e09407e655
+2
View File
@@ -193,6 +193,7 @@ function assetHandler(ctx: Context, projectDir: string): ConnectionFetchHandler
return new Response(body, { headers: { 'content-type': MIME['.html'] ?? 'text/html; charset=utf-8' } })
}
return {
requestBodyMode: () => 'buffered',
async fetch(request): Promise<Response> {
if (request.method !== 'GET' && request.method !== 'HEAD') return new Response(null, { status: 405 })
const url = new URL(request.url)
@@ -221,6 +222,7 @@ function assetHandler(ctx: Context, projectDir: string): ConnectionFetchHandler
function remoteStreamHandler(ctx: Context): ConnectionFetchHandler {
return {
requestBodyMode: () => 'buffered',
async fetch(request): Promise<Response> {
if (request.method !== 'POST') return new Response(null, { status: 405 })
const gateway = ctx.get('typertGateway')