Skip to content

Fix Mixed Content Issue on Bot Selection Page by Enforcing HTTPS Endpoints#207

Open
sundar410 wants to merge 1 commit intoOpenNyAI:mainfrom
sundar410:mixed-content-fix
Open

Fix Mixed Content Issue on Bot Selection Page by Enforcing HTTPS Endpoints#207
sundar410 wants to merge 1 commit intoOpenNyAI:mainfrom
sundar410:mixed-content-fix

Conversation

@sundar410
Copy link

@sundar410 sundar410 commented Apr 13, 2025

This pull request resolves a mixed-content error observed on the Bot selection page. The issue was caused by some API endpoints being constructed with an HTTP scheme (e.g., http://XXX/v2/bot/...) even when the page was loaded over HTTPS. Browsers were consequently blocking these insecure requests.

Before:

The BotSettings.tsx file was using a variable for the API host that sometimes included an HTTP URL, causing mixed-content warnings/errors.

For example, API calls like http://XXX/v2/bot/ were made when the site was served securely over HTTPS, resulting in blocked requests.
image
image

After:

The API endpoint references in BotSettings.tsx have been updated to force HTTPS— so that all calls to /v2/bot and /v2/channel are made securely.

The changes ensure that all API calls are constructed with the HTTPS protocol, thereby preventing mixed-content issues.

image

Changes Made in BotSettings.tsx:

Updated API endpoint URLs by replacing any instance of http://XXX with secure endpoints (https://XXX), ensuring that the API host is always using HTTPS.

Introduced (or adjusted) the logic to enforce HTTPS when building API URLs.

Verified that all calls to bot and channel endpoints now use secure URLs, resolving the mixed-content error.

Testing:

Locally verified with browser Developer Tools that all API requests from BotSettings.tsx are now made over HTTPS.

Confirmed that the Bot selection page no longer shows mixed-content errors, and all related functionalities (bot selection, channel update, deletion) work as expected.

Ref: https://stackoverflow.com/questions/70351360/keep-getting-307-temporary-redirect-before-returning-status-200-hosted-on-fast

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

Successfully merging this pull request may close these issues.

1 participant