# Fix a CORS error properly

> The browser blocks a request, and the quick fix is to allow everything.

Web page: https://buildladder.com/resources/prompts/cors-error

What you get: The reason this request is blocked, and the narrowest setting that lets it through.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
The browser console shows a CORS error when my frontend calls [the API or service].

Explain in two sentences what the browser is refusing and why. Then find out which case this is: my own API missing the right headers, a preflight request that isn't answered, cookies sent without credentials being allowed, a redirect in the middle, or a third-party API that has to be called from my server instead of the browser.

Fix it in the right place with the narrowest rule: my real origins only, no wildcard. If the request belongs on the server, move it there and keep the key out of the browser. Show me the response headers after the fix.
```
