I use cloudflare worker as a reverse proxy of openai, but got following error response (i’m pretty sure that before today, all things worked perfectly):
<h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> api.openai.com</h2>
</div><!-- /.header -->
<div class="cf-section cf-highlight">
<div class="cf-wrapper">
<div class="cf-screenshot-container cf-screenshot-full">
<span class="cf-no-screenshot error"></span>
</div>
</div>
</div><!-- /.captcha-container -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>
<p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
I have a question that I don’t quite understand, does the default fech of the worker pass the cf by default? Why does openai still recognize my locale even though I’ve proxied the request via fetch, the header address has been rewritten, and the cf has not been passed?
You would have to ask that question to OpenAI, we do not have any insight into how they may have configured their rules. Any advice would be inaccurate speculation and it is best to contact OpenAI with questions. Thanks!
You cannot overwrite any of the cf- headers, x-real-ip or Host. They will be overwritten back to their intended value. Workers cannot be used to spoof requests in this way. Thanks for the question!