-1

I am trying to access an API on the Javascript client side and get a CORS error. Is there a way to set the Origin to "*" on the client side? Thanks.

Failed to load https://: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://’ is therefore not allowed access."

georgeawg
  • 48,608
  • 13
  • 72
  • 95
Mitch
  • 31
  • 3
  • 2
    No. If there were, it would be a massive security problem. CORS headers have to come from the server. – Pointy Apr 05 '18 at 18:49
  • you can use --disable-web-security parameter when start chrome but there is no way to bypass CORS at every client and it should not as @Pointy said – Tamer Aktaş Apr 05 '18 at 18:54

1 Answers1

1

NO, this is not possible.

The server side decides from which origin it's service could be consumed. By default, the policy is set to Same-origin and only the server side can override this policy be adding the CORS header. If client could override the same-origin policy, then there would be a major security issue.

Marcus Höglund
  • 16,172
  • 11
  • 47
  • 69