Hey Folks,
I’m playing with Home Panel, and I’m running into the old chestnut CORS problems.
I like to think I know what I’m doing, but am not having much luck.
So, I have homepanel, running on port 80. Which I access via:
http://homeassistant/
And I’ve setup the configuration.yaml with the following:
http:
cors_allowed_origins:
- http://homeassistant:80
- http://homeassistant
And I still get a Method Not allowed and chrome refuses to collect data for the graphs.
Questions:
A) Which component am I restarting to restart the http component? (I’ve basically been doing a full host restart for completeness… But is Core enough?
B) I’ve been using CURL to see if I can a ‘pass’ on the CORS:
curl -H "Origin: http://homeassistant" -H "Access-Control-Request-Method: GET" -X OPTIONS --verbose 'http://homeassistant:8123/api/history/period/2021-02-22T23:39:42.481Z?filter_entity_id=sensor.somesensor&end_time=2021-02-23T05:39:42.481Z'
Which returns:
* TCP_NODELAY set
* Connected to homeassistant (192.168.1.159) port 8123 (#0)
> OPTIONS /api/history/period/2021-02-22T23:39:42.481Z?filter_entity_id=sensor.somesensor&end_time=2021-02-23T05:39:42.481Z HTTP/1.1
> Host: homeassistant:8123
> User-Agent: curl/7.64.1
> Accept: */*
> Origin: http://homeassistant
> Access-Control-Request-Method: GET
>
< HTTP/1.1 405 Method Not Allowed
< Content-Type: text/plain; charset=utf-8
< Allow: GET
< Content-Length: 23
< Date: Tue, 23 Feb 2021 05:54:46 GMT
< Server: Python/3.8 aiohttp/3.7.3
<
Anyone have any ideas for me?
Running Latest and greatest:
2021.2.3 and OS 5.12 on a supervised VM install.