workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

Adding host_metadata to Cloudflare Request Data

Open mettke opened this issue 1 year ago • 0 comments

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.

mettke avatar Jun 30 '23 13:06 mettke