--cors not working
See original GitHub issueXMLHttpRequest cannot load http://127.0.0.1:8081/feeds.json. Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response
$ http-server --cors
Starting up http-server, serving ./
Available on:
http://127.0.0.1:8081
http://192.168.1.3:8081
Here are the headers:
Response Headers
access-control-allow-headers:Origin, X-Requested-With, Content-Type, Accept, Range
access-control-allow-origin:*
Connection:keep-alive
Date:Sun, 03 Sep 2017 07:51:28 GMT
Request Headers
view source
Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:authorization
Access-Control-Request-Method:GET
This is the OPTIONS request in chrome that is failing.
Issue Analytics
- State:
- Created 6 years ago
- Comments:29 (6 by maintainers)
Top Results From Across the Web
CORS errors and how to solve them
Open a network tab in your console. ... In the response header look for the Access-Control-Allow-Origin header. If it does not exist then...
Read more >CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin ...
Read more >3 Ways to Fix the CORS Error — and How the Access- ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >CORS not working on Chrome
CORS will work in chrome. Just use chrome is safe-mode, i.e., use disable security settings. Google ...
Read more >What Is a CORS Error and How to Fix It (3 Ways)
Solution 1: Configure the Backend to Allow CORS · Solution 2: Use a Proxy Server · Solution 3: Bypass the Error Using a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had to pass
--cors=Authorization
This is potentially unrelated to some of the more specific comments, but in general if you’re only testing in browser, the default caching of one hour can cause the non-cors response to be cached and fail to get the new cors response.