Skip to content

Conversation

JakeChampion
Copy link
Contributor

It is currently named FetchEvent, which can lead to confusion when logging out the value. For example this application logs the client info prototype and the fetch event prototype:

addEventListener("fetch", event => event.respondWith(handleRequest(event))) async function handleRequest(event) { console.log(event.client.__proto__) console.log(event.__proto__) return new Response; }

The log lines look like this:

Log: FetchEvent { address: [Getter], geo: [Getter], tlsCipherOpensslName: [Getter], tlsProtocol: [Getter], tlsJA3MD5: [Getter], tlsClientCertificate: [Getter], tlsClientHello: [Getter] } Log: FetchEvent { client: [Getter], request: [Getter], respondWith: [ function respondWith() {[native code]}], waitUntil: [ function waitUntil() {[native code]}] } 

We can see that the class name is included in the log and they both have the class name FetchEvent right now

@JakeChampion JakeChampion requested a review from guybedford July 25, 2024 10:39
@JakeChampion JakeChampion marked this pull request as ready for review July 25, 2024 13:35
It is currently named `FetchEvent`, which can lead to confusion when logging out the value. For example this application logs the client info prototype and the fetch event prototype: ```js addEventListener("fetch", event => event.respondWith(handleRequest(event))) async function handleRequest(event) { console.log(event.client.__proto__) console.log(event.__proto__) return new Response; } ``` The log lines look like this: ``` Log: FetchEvent { address: [Getter], geo: [Getter], tlsCipherOpensslName: [Getter], tlsProtocol: [Getter], tlsJA3MD5: [Getter], tlsClientCertificate: [Getter], tlsClientHello: [Getter] } Log: FetchEvent { client: [Getter], request: [Getter], respondWith: [ function respondWith() {[native code]}], waitUntil: [ function waitUntil() {[native code]}] } ``` We can see that the class name is included in the log and they both have the class name FetchEvent right now
@JakeChampion JakeChampion force-pushed the jake/clientinfo-class-name branch from 096ba87 to 7a24e7f Compare July 25, 2024 16:48
@JakeChampion JakeChampion merged commit efb5694 into main Jul 26, 2024
@JakeChampion JakeChampion deleted the jake/clientinfo-class-name branch July 26, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants