Cloudflare DevelopersCD
Cloudflare Developers3y ago
13 replies
Paolo

Enriching EventContext

What is the best way to enrich EventContext?
For security reason we need to a lot of checks during the middleware, for example to check for CSRF, sessions/login, and so on.
It would be really helpful to be able to pass more data down the next function/middleware. This cannot be done directly with headers in a safe way. What's the best way to do so? what's a safe way to enrich the context?

Related: https://developers.cloudflare.com/pages/functions/api-reference/ lists some fields that are not described.
Learn about the APIs used within Pages Functions.
API reference · Cloudflare Pages docs
Was this page helpful?