Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

I built AnotherExample: a free tool for troubleshooting CORS

AnotherExample, a free tool by Arthur G, compares a failing request with a known-working test endpoint. Here is how to read CORS errors and fix the server-side cause.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A CORS error means the browser refused to let your page read a cross-origin response because the response did not grant that access. The fix almost always sits on the server that produced the response, not in your page’s JavaScript. AnotherExample, a free tool built by developer Arthur G, helps you narrow the search by comparing a failing request with a similar request to a known-working test endpoint.

What AnotherExample does

According to Arthur G’s DEV Community article introducing the tool, AnotherExample is free and compares a failing request with a similar request sent to a known-working test endpoint. The point of the comparison is to show where the two requests differ, so you know where to look next. In the author’s words: “The comparison helps narrow down where to investigate next.”

As an Amazon Associate I earn from qualifying purchases.

The same article calls the tool a work in progress and invites feedback. It is a diagnostic aid. It does not change a remote server’s policy, and the article does not document the exact test coverage, privacy behavior, or the browsers and CORS scenarios it supports. Treat its output as a lead to check against the browser’s own messages, not as a verdict on the server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the browser blocks the request

Browsers enforce the same-origin policy: by default a page can only read responses from the same origin, meaning the same scheme, host, and port. CORS (Cross-Origin Resource Sharing) is the mechanism a server uses to relax that rule. The server sends response headers that name which other origins may read the resource, and the browser checks them before handing the response to your code.

A CORS error therefore has one of two broad causes. Either the server intentionally does not allow the requesting origin, or the response does not satisfy the browser’s CORS checks, for example because a header is missing, mismatched, or sent in the wrong form. In both cases the server controls the outcome. Your page can only change the request it sends.

Read the browser’s own diagnosis first

JavaScript does not receive the detailed reason for a CORS rejection. A failed fetch() typically surfaces as a generic network error, so the browser’s developer tools are where the specific reason appears.

  1. Open developer tools. In Chrome, Edge, or Firefox, press F12 on Windows or Linux, or Cmd+Option+I on macOS.
  2. Select the Console tab, reload the page, and trigger the request. Chromium-based browsers print messages such as “has been blocked by CORS policy” and name the missing or mismatched header. Firefox uses different wording, so read the full message rather than matching a phrase.
  3. Select the Network tab, click the failing request, and open Headers to inspect the request headers and the response headers.
  4. If the request was not a simple one, look for a preceding request with method OPTIONS. This is the preflight, and its status and response headers matter as much as the main request’s.

Compare the failing request with a working one

Whether you use AnotherExample or a manual comparison, the useful unit of analysis is the pair of requests. Check the same axes on each.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Axis What to compare Mismatch that commonly causes a block
Requesting origin Scheme, host, and port of the page making the call Page served over http while the API expects https, or a different port, so the origin is not in the allow-list
URL and redirects The final URL after any redirects A redirect to another host, where the target’s responses lack the expected CORS headers
Method GET, POST, PUT, PATCH, DELETE, and so on A method other than GET, HEAD, or POST triggers a preflight that the server does not answer
Request headers Authorization, custom headers, and Content-Type A custom header or Content-Type such as application/json triggers a preflight, and the header is absent from Access-Control-Allow-Headers
Preflight response Status and headers of the OPTIONS response A non-success status, or missing Access-Control-Allow-Methods or Access-Control-Allow-Headers
Credentials Whether cookies or HTTP authentication are sent Credentials are included, but the server answers with a wildcard origin or omits Access-Control-Allow-Credentials
Response headers Access-Control-Allow-Origin and related headers on the main response The header is missing, or its value does not match the requesting origin exactly

Where the working request differs from the failing one on one axis, you have a strong lead. Where they differ on several, change one variable at a time and retest.

Fixing the most common causes

Missing Access-Control-Allow-Origin

If the console reports that the header is absent, the response did not grant your origin. If you control the server, return Access-Control-Allow-Origin with the value of the requesting origin, for example https://app.example.com. A wildcard * is acceptable only for public resources that do not need credentials. If the server answers different origins with different values, send Vary: Origin so caches do not serve one origin’s response to another.

Credentials and the wildcard

Credentialed requests are stricter. The client must opt in with credentials: 'include' in fetch(), or withCredentials = true on an XMLHttpRequest. The server must then send Access-Control-Allow-Credentials: true and must name the exact origin in Access-Control-Allow-Origin. A wildcard * is not permitted in this case, so a fix that works without credentials can break as soon as cookies are added.

Preflight failures

A preflight is a permission check the browser sends before the real request, for requests with non-simple methods, custom headers, or certain content types. The server must answer the OPTIONS request with a success status and the headers that cover the actual request:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Access-Control-Allow-Origin matching the requesting origin
  • Access-Control-Allow-Methods including the method you use
  • Access-Control-Allow-Headers including every custom header and Content-Type value you send
  • Optionally, Access-Control-Max-Age to let the browser cache the preflight result

If the API design allows it, you can also change the request shape, such as dropping an unnecessary custom header, so no preflight is needed. Do this only where the change keeps the API’s behavior correct.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

If you do not control the server

Your options are narrower. You can ask the service owner to add an allow-origin value for your site, which is the durable fix. Alternatively, you can send the request from a server you control. Server-to-server calls are not subject to the browser’s CORS checks, so your backend can forward the request and return the result to your page. Be cautious with third-party services that offer to bypass CORS for you: they see your request and any credentials or data in it.

Why no-cors is not a general fix

Setting mode: 'no-cors' in fetch() lets the request go out, but the response is opaque. JavaScript cannot read its status, headers, or body. That makes it suitable only when the page does not need to inspect the result, such as some fire-and-forget beacons or image and script loads. For an API call whose result your code uses, it hides the problem rather than solving it.

What the comparison can and cannot establish

A failing-versus-working comparison can show which header, method, or credential setting differs, and that is often enough to direct a fix. It cannot prove that a remote server’s policy is wrong, and it cannot confirm that a given server will accept your origin. Verify any finding against the browser console and the server’s response headers before you rely on it. Before pasting a request that contains tokens or personal data into any online tool, read the tool’s own page for its current data-handling terms, since the author’s article does not establish them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For the underlying rules, the MDN Web Docs pages on CORS and on CORS errors are the reference to check the header semantics against.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.