Can I modify the Method Request header when sent to origin?
I have an edge request coming with method = POST, but need to convert it to GET method before sending to origin (S3 bucket). The incoming request is to open an html page but unfortunately it is a 3rd party that can't convert to GET when calling.
here is what I am trying but it doesnt seem to be working. I tried the header name to be Method or method but did not work. I dont have workers, so trying to do this on the UI.
7 Replies
Workers is the only way currently, Rules dont have support for transforming the method
In the future you can solve this with Snippets (https://blog.cloudflare.com/cloudflare-snippets-alpha/)
The Cloudflare Blog
Cloudflare Snippets is now available in alpha
Cloudflare Snippets are available in alpha. Snippets are a simple way of executing a small piece of Javascript on select HTTP requests, using the ruleset engine filtering logic
Thanks. @Erisa | Support Engineer for the immediate response. I have an enterise plan, but did not add Workers in my contract. Can I still use workers? or is that a question to my Account team? Also, if workers can be used, is this the example I can use https://developers.cloudflare.com/workers/examples/modify-request-property/
Modify request property · Cloudflare Workers docs
Documentation for Cloudflare Workers, a serverless execution environment that allows you to create entirely new applications or augment existing ones …
It's a question for your account team, though depending on how your account is setup you can proactively enable a trial from the dashboard
And yes that's the example
I'd also recommend telling your account team you're interested in Snippets because those would work for these small use cases without the cost overhead of Workers
thanks for the suggestion - I will follow up with them. Would you know if by any chance there is something in the roadmap to allow the Transform rules to support this?
I am planning to generate a support ticket too, but just wanted to check with you
Not sure off the top of my head, either ask your account team or raise a ticket
will do - thanks again for the quick response.