-1

How to avoid "Request header field Authorization is not allowed by Access-Control-Allow-Headers" error running JavaScript from local drive? So I cannot modify server headers as there is no server. Thank you.

That is not duplicate as solution offered at 'Origin null is not allowed by Access-Control-Allow-Origin' does not work, you can read about it there.

Community
  • 1
  • 1
  • The definitely best is to use a local webserver (xampp, easyphp, wamp etc), but you can also run Chrome with the `--allow-file-access-from-files` flag. It is explained more in-depth in the [linked dupe](http://stackoverflow.com/q/8456538/1331430)'s answers. – Fabrício Matté May 19 '14 at 12:30
  • Thank you but --allow-file-access-from-files does not seem to work for me – user3652613 May 19 '14 at 13:37
  • Well yes, you are always better off using a local server... There are a too many dupes of this ([hundreds at least](https://www.google.com.br/search?q=site%3Astackoverflow+origin+null+is+not+accepted+by&oq=site%3Astackoverflow+origin+null+is+not+accepted+by&aqs=chrome..69i57j69i58.11073j0j7&sourceid=chrome&es_sm=93&ie=UTF-8#q=site%3Astackoverflow.com+origin+null+is+not+accepted+allowed+by+Access-Control-Allow-Origin)), and every single one will tell you to use a local server or that flag. – Fabrício Matté May 19 '14 at 13:43
  • As long as you don't provide info that differentiates your use case from the other hundreds of questions linked above, it is still a dupe, sorry. – Fabrício Matté May 19 '14 at 13:44

1 Answers1

-1

No. You will need a server like Mongoose (very simple download and run in your root). A very easy fix.

dSkech
  • 339
  • 1
  • 5