Fix URLS for dashboards and other internal endpoints - to support HTTPS

Request:

change all URLS internally in Hubitat's code to not hardcode a HTTP/HTTPS scheme (e.g. in dashboards its hardcoded to use a non-HTTPS scheme) which causes an issue is using a reverse proxy to host your hub or just using HTTPS to load the dashboard.

E.g. If browsing the hub using HTTPS and you click dashboards then try to open any dashboard. It fails with the following browser error:
VM588 app.js:1 Mixed Content: The page at 'https://hubitat-hub/dashboards' was loaded over HTTPS, but requested an insecure frame 'http://hubitat-hub/apps/api/X/dashboard/YY?access_token=GUID'. This request has been blocked; the content must be served over HTTPS.

Recommendation: use '//' instead of HTTP:// or HTTPS:// in the URI of the output. Using just the slash scheme will cause the browser to use the same scheme as was was used to load the page content. So if using HTTPS it will cause all urls to also load HTTPS as well as if using HTTP all urls to load HTTP.

Thank you.

5 Likes