workers-rs
workers-rs copied to clipboard
[Feature] Access to hostMetadata for custom hostnames using the CF Struct
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
We are using Cloudflare Custom Hostnames and we are assigning hostMetadata to these hostnames to be able to get information about the project. Unfortunately its currently not possible to get this information from the Cf
Struct and it would be very nice if we can add this.
Example Structure:
{
"clientTcpRtt": 0,
"longitude": "...",
"latitude": "...",
"tlsCipher": "...",
"continent": "...",
"asn": 0,
"clientAcceptEncoding": "...",
"country": "...",
"isEUCountry": "",
"tlsClientAuth": {},
"postalCode": "...",
"tlsExportedAuthenticator": {},
"tlsVersion": "TLSv1.3",
"city": "...",
"timezone": "...",
"hostMetadata": {
"domain": "custom_data"
},
"colo": "...",
"edgeRequestKeepAliveStatus": 1,
"requestPriority": "...",
"botManagement": {},
"clientTrustScore": 0,
"region": "...",
"regionCode": "...",
"asOrganization": "...",
"httpProtocol": "HTTP/2"
}
What needs to be done:
- IncomingRequestCfProperties in worker-sys needs to expose hostMetadata as custom json
- Cf also needs to expose hostMetada