Przeglądaj źródła

fix(desktop): adapt host fetch handlers

07akioni 2 tygodni temu
rodzic
commit
e09407e655
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      apps/desktop-host/src/index.ts

+ 2 - 0
apps/desktop-host/src/index.ts

@@ -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 new Response(body, { headers: { 'content-type': MIME['.html'] ?? 'text/html; charset=utf-8' } })
   }
   }
   return {
   return {
+    requestBodyMode: () => 'buffered',
     async fetch(request): Promise<Response> {
     async fetch(request): Promise<Response> {
       if (request.method !== 'GET' && request.method !== 'HEAD') return new Response(null, { status: 405 })
       if (request.method !== 'GET' && request.method !== 'HEAD') return new Response(null, { status: 405 })
       const url = new URL(request.url)
       const url = new URL(request.url)
@@ -221,6 +222,7 @@ function assetHandler(ctx: Context, projectDir: string): ConnectionFetchHandler
 
 
 function remoteStreamHandler(ctx: Context): ConnectionFetchHandler {
 function remoteStreamHandler(ctx: Context): ConnectionFetchHandler {
   return {
   return {
+    requestBodyMode: () => 'buffered',
     async fetch(request): Promise<Response> {
     async fetch(request): Promise<Response> {
       if (request.method !== 'POST') return new Response(null, { status: 405 })
       if (request.method !== 'POST') return new Response(null, { status: 405 })
       const gateway = ctx.get('typertGateway')
       const gateway = ctx.get('typertGateway')