Cloudflare is a web security company that provides infrastructure, security and caching services for some of the best online platforms on the globe. We use Cloudflare to protect our systems from attacks from malicious actors and it could be that Cloudflare is seeing your IP address as compromised.
If you receive an error that indicates Cloudflare is restricting your connection, follow these steps to fix the issue;
-
Send a user-agent in your request header. For example, you can use the Chrome UA like this
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
This means if your header was previously something like
curl <https://api.paystack.co/xxxx> \\ -H "Authorization: Bearer SECRET_KEY" \\ -H "Content-Type: application/json" \\ -d '{ "reference": "7PVGX8MEk85tgeEpVDtD", "amount": 500000 }' \\ -X POST
then it should now be
curl <https://api.paystack.co/xxxx> \\ -H "Authorization: Bearer SECRET_KEY" \\ -H "Content-Type: application/json" \\ -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" \\ -d '{ "reference": "7PVGX8MEk85tgeEpVDtD", "amount": 500000 }' \\ -X POST
-
If you are still getting blocked by Cloudflare after this, you will need to have a conversation with your host. This will mean that your IP address is blacklisted. If you can talk to your host, they should be able to change this at no extra cost.
Comments
0 comments
Article is closed for comments.