Since one of the last updates to 3.x, OpenWebUI no longer loads. The DevTools console throws:
Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure resource 'http://example.com/api/v1/tools/'. This request has been blocked; the content must be served over HTTPS.
TypeError: Failed to fetch
at window.fetch ...
The fetch function in question makes a request to an API endpoint that has a constant in it which is hardcoded as http:
This causes issues, as the page is trying to load a http resource over a https page, essentially.
A potential solution would be getting the protocol to correctly prepend http or https, depending on the instance. Maybe location.protocol?
Originally created by @Fusseldieb on GitHub (Jun 12, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3069
Since one of the last updates to 3.x, OpenWebUI no longer loads. The DevTools console throws:
```
Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure resource 'http://example.com/api/v1/tools/'. This request has been blocked; the content must be served over HTTPS.
TypeError: Failed to fetch
at window.fetch ...
```
The fetch function in question makes a request to an API endpoint that has a constant in it which is hardcoded as **http**:
https://github.com/open-webui/open-webui/blob/0917fa6f4ac015810211d85eb41da5d335762952/src/lib/constants.ts#L7
This causes issues, as the page is trying to load a http resource over a https page, essentially.
A potential solution would be getting the protocol to correctly prepend http or https, depending on the instance. Maybe `location.protocol`?
<!-- gh-comment-id:2163183724 -->
@rbrinson commented on GitHub (Jun 12, 2024):
I just posted about the same issue (https://github.com/open-webui/open-webui/issues/3074). So, me too!
A potential solution would be getting the protocol to correctly prepend http or https, depending on the instance. Maybe location.protocol?
Indeed, constructing URLs with string templates is always the cause for these annoying bugs. In addition, i would also modify the WEBUI_HOSTNAME constant, as it also assumes we are using the port 8080. Although i would personally remove it...
// WEBUI_HOSTNAME could be removed: https://github.com/search?q=repo%3Aopen-webui%2Fopen-webui%20WEBUI_HOSTNAME&type=code
exportconstWEBUI_HOSTNAME=browser?(dev?location.host:``):'';exportconstWEBUI_BASE_URL=browser?(dev?location.origin:``):``;
<!-- gh-comment-id:2163387845 -->
@Altair-Bueno commented on GitHub (Jun 12, 2024):
> A potential solution would be getting the protocol to correctly prepend http or https, depending on the instance. Maybe location.protocol?
Indeed, constructing URLs with string templates is always the cause for these annoying bugs. In addition, i would also modify the `WEBUI_HOSTNAME` constant, as it also assumes we are using the port 8080. Although i would personally remove it...
```js
// WEBUI_HOSTNAME could be removed: https://github.com/search?q=repo%3Aopen-webui%2Fopen-webui%20WEBUI_HOSTNAME&type=code
export const WEBUI_HOSTNAME = browser ? (dev ? location.host : ``) : '';
export const WEBUI_BASE_URL = browser ? (dev ? location.origin : ``) : ``;
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Fusseldieb on GitHub (Jun 12, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3069
Since one of the last updates to 3.x, OpenWebUI no longer loads. The DevTools console throws:
The fetch function in question makes a request to an API endpoint that has a constant in it which is hardcoded as http:
https://github.com/open-webui/open-webui/blob/0917fa6f4ac015810211d85eb41da5d335762952/src/lib/constants.ts#L7
This causes issues, as the page is trying to load a http resource over a https page, essentially.
A potential solution would be getting the protocol to correctly prepend http or https, depending on the instance. Maybe
location.protocol?@rbrinson commented on GitHub (Jun 12, 2024):
I just posted about the same issue (https://github.com/open-webui/open-webui/issues/3074). So, me too!
@Altair-Bueno commented on GitHub (Jun 12, 2024):
Indeed, constructing URLs with string templates is always the cause for these annoying bugs. In addition, i would also modify the
WEBUI_HOSTNAMEconstant, as it also assumes we are using the port 8080. Although i would personally remove it...