New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--cors not working #394
Comments
|
I had to pass |
|
I believe I am having the same issue. Passing |
Same problem here. |
@TeodorKolev @ansermino @Kazanz are you all simply using The test for this feature is here: Please extend it to test your scenario/usage expectation and lets see what we can figure out! 😃 |
@BigBlueHat After fiddling around turns out CORS was working in Firefox but not in chrome, because of the capitalization of the header. |
This one works for me: http-server {folder} --cors=http://localhost:3000/ |
Capitalization of the CORS We'll need to narrow down the scenario and test it before we change the code for this feature. Thanks! |
@PhilTheAir the |
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. |
I'm having a problem with reading headers within an XHR request in Chrome. 'Access-Control-Expose-Headers' needs to be supported as well. mozilla/pdf.js#3150 (comment) |
I had the same problem. I solved it by installing cors global |
--cors without value works, probably browser cache issue, hit ctrl + f5 |
It may be the cause of browser caching. |
same issue here. tried
|
I'm on the same scenario here...what ended up working for you, @ryanbuckleyca ?
|
Hello, facing similar cors issue, when trying to load some external file within the application, |
|
Is anyone having trouble with this on v13 and cache resetting does not fix the problem? |
|
🎉 I'll close this as fixed in v13 then, please reopen if it appears broken again and resetting cache does not fix it |
so uh yea it stopped working again. I did everything I could but it just does not work |
@BeyYT what is everything you did and tried? |
I tried http-server --cors=* -p8110 -c-1 but the browser shows" has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled." |
Every option, CORS header, even * and it still doesn’t work. |
@BeyYT a sample repo link, with the http-server version you are using, might help. |
Just a heads up for any future googlers... Make sure you open dev tools, go to the network tab, select disable cache, then refresh. Control F5 did not do the trick for me. |
the sample repo has been on my github for a long time now. aswell the http-server version is the latest version there is. |
XMLHttpRequest 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
Here are the headers:
This is the OPTIONS request in chrome that is failing.
The text was updated successfully, but these errors were encountered: