Can I set custom request headers in Cloudflare Pages?

I wish to set custom request headers, but I do not seem to be able to.
I have an associated domain with transform rules, but they do not appear to affect the Cloudflare page’s website. I know it is possible for response headers. Is there anything to do for request headers?
Thanks!

Request headers for what exactly? Can you share any more information about the use-case and what you’re trying to do? Request headers are controlled by the client, so for example, I could do:

curl -H "my-name-is: slim-shady" example.pages.dev and I could then read that header in a Pages Function just fine.

As for making outbound requests within Functions with custom headers, you can add these to your fetch call.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.