From 94b92bc348c086d70df97d9188d1a77212100d2f Mon Sep 17 00:00:00 2001 From: velzie Date: Thu, 10 Oct 2024 20:59:55 -0400 Subject: [PATCH] add some more fun properties to the event --- src/worker/fetch.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/worker/fetch.ts b/src/worker/fetch.ts index 6870e6b..8875df6 100644 --- a/src/worker/fetch.ts +++ b/src/worker/fetch.ts @@ -245,6 +245,10 @@ async function handleResponse( ev.responseHeaders = responseHeaders; ev.status = response.status; ev.statusText = response.statusText; + ev.destination = destination; + ev.url = url; + ev.rawResponse = response; + ev.client = client; swtarget.dispatchEvent(ev); return new Response(ev.responseBody, { @@ -259,4 +263,8 @@ export class ScramjetHandleResponseEvent extends Event { public responseBody: string | ArrayBuffer | ReadableStream; public status: number; public statusText: string; + public destination: string; + public url: URL; + public rawResponse: BareResponseFetch; + public client: Client; }