How do we override the CF-IPCountry header sent to our website? We need it for testing

We have a website built in ASP.NET MVC, we have implemented some custom behavior based on if the user is coming from China.

We would now like to test and sign off this feature in the production environment, but can only do so by ‘appearing’ to come from China.

We check the user country with CloudFlare’s request header ‘CF-IPCountry’.
Is there some way to spoof this header to the test the functionality on our website?

You can set whatever headers you want if you go straight to the origin server. curl will let you do this.

I have never worked with Curl, can I use it with Chrome to impersonate a user browsing the website as if they are coming from China?

I need to do several things in the session to test the new functionality, so how would I wire up Chrome with curl to do this?

I don’t think Chrome does this easily, but Firefox dev tools (similar to Chrome’s) will let you right click on a URL and edit/resend that request with any new headers you’d like to include.

This topic was automatically closed after 14 days. New replies are no longer allowed.