If you use postman does the same thing happen? Usually this indicates whatever you are using to make the GET request is trying to do a preflight check. Which shouldn’t be required I do not think.
The problem: even this example doesn’t work.
For me, it only needs a long lived token, but this doens’t seem to be the case.
Is there ANY link which provides me some useful hints how to configure hass.io so I can fetch simple data via Rest API?
Unfortunately if you are trying to use a webapp to make the call from the browser I’m not sure there is not much you can do. Fetch, axios, and all of those things all make preflight requests from the browser anyway. I also don’t think home assistant should allow any other origins as it would create security vulnerabilities. You could possible make a backend service that makes a the call via a node services instead of from the browser.
Thank you
As you can see in my initial post, I just used this option, without a success.
BUT when I checked the blocked request from my app, I just found that the origin in the request is my development server which is (surprise) localhost.
So, if you are going to run in this problem:
Add localhost to your cors_allowed_origin configuration OR whatever origin is set in the request. You can check this in the development tools of your browser, in the request header under the “network” tab.
FYI, I’m trying to build a standalone local web app and I ran into a similar issue. So just thought I’d point out something that I didn’t discover until after banging my head against the wall for hours. If you want to make use of the REST API be sure to add this line to your configuration.yaml file:
CORS from configuration are not working, am I missing something?
This is my error: Access to image at 'http://192.168.188.1:49000/FRITZ-Logo-120x120.png' from origin 'http://1nuc.mooo.com:20536' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private.
I am accessing my HA with hostname not IP, with local IP all is working. I tried this in Media section DLNA Servers.