workers-rs
workers-rs copied to clipboard
Adding host_metadata to Cloudflare Request Data
Fixes: #347
This adds two new functions. One for IncomingRequestCfProperties
to access the hostMetadata
as documented here: https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/ and another for Cf
to allow the user to supply a custom Rust Struct for the field to be serialized to.
This was tested using Cloudflare Custom Domains with Custom Metadata attached.