minitel-cloudflare-worker
Advanced tools
Comparing version 2.0.0 to 2.0.1
declare const _default: { | ||
fetch(request: Request): Promise<Response | undefined>; | ||
fetch(request: Request, _: {}, ctx: ExecutionContext): Promise<Response | undefined>; | ||
}; | ||
export default _default; |
@@ -15,4 +15,4 @@ import { Duplex, DuplexOptions } from 'node:stream'; | ||
export declare function createMinipaviHandler(minitelFactory: (ws: Duplex, req: Request) => any, options?: MinipaviHandlerOptions): { | ||
fetch(request: Request): Promise<Response | undefined>; | ||
fetch(request: Request, _: {}, ctx: ExecutionContext): Promise<Response | undefined>; | ||
}; | ||
export {}; |
@@ -72,3 +72,3 @@ import { z } from 'zod'; | ||
return { | ||
async fetch(request) { | ||
async fetch(request, _, ctx) { | ||
const reqUrl = new URL(request.url); | ||
@@ -86,2 +86,4 @@ const upgradeHeader = request.headers.get('Upgrade'); | ||
setTimeout(() => minitelFactory(stream, request), 1); | ||
const streamEnd = new Promise((r) => stream.on('end', () => r())); | ||
ctx.waitUntil(streamEnd); | ||
return new Response(null, { | ||
@@ -88,0 +90,0 @@ status: 101, |
{ | ||
"name": "minitel-cloudflare-worker", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A cloudflare worker for access through MiniPAVI", | ||
@@ -29,3 +29,3 @@ "main": "dist/index.js", | ||
"@cloudflare/workers-types": "^4.20240725.0", | ||
"minitel-standalone": "^1.9.5", | ||
"minitel-standalone": "^1.9.6", | ||
"prettier": "3.3.3", | ||
@@ -32,0 +32,0 @@ "typescript": "^5.5.4" |
@@ -93,3 +93,3 @@ import { z } from 'zod'; | ||
return { | ||
async fetch(request: Request) { | ||
async fetch(request: Request, _: {}, ctx: ExecutionContext) { | ||
const reqUrl = new URL(request.url); | ||
@@ -111,2 +111,5 @@ | ||
const streamEnd = new Promise<void>((r) => stream.on('end', () => r())); | ||
ctx.waitUntil(streamEnd); | ||
return new Response(null, { | ||
@@ -113,0 +116,0 @@ status: 101, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27700
447