Skip to content
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

Mixed Content w/ HTTPS #3069

Closed
Fusseldieb opened this issue Jun 12, 2024 · 2 comments
Closed

Mixed Content w/ HTTPS #3069

Fusseldieb opened this issue Jun 12, 2024 · 2 comments

Comments

@Fusseldieb
Copy link
Contributor

Fusseldieb commented Jun 12, 2024

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:

export const WEBUI_BASE_URL = browser ? (dev ? `http://${WEBUI_HOSTNAME}` : ``) : ``;

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
Copy link

I just posted about the same issue (#3074). So, me too!

@Altair-Bueno
Copy link

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:open-webui/open-webui WEBUI_HOSTNAME&type=code
export const WEBUI_HOSTNAME = browser ? (dev ? location.host : ``) : '';
export const WEBUI_BASE_URL = browser ? (dev ? location.origin : ``) : ``;

Altair-Bueno added a commit to Altair-Bueno/open-webui that referenced this issue Jun 12, 2024
@tjbck tjbck closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants