Skip to content

fix(web): treat configured urls with uppercase schemes as secure - #8005

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/case-insensitive-url-scheme
Aug 23, 2026
Merged

fix(web): treat configured urls with uppercase schemes as secure#8005
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/case-insensitive-url-scheme

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Problem

resolveConfiguredPrimaryTarget classifies VITE_WS_URL / VITE_HTTP_URL with case-sensitive startsWith("wss:") / startsWith("https:") checks, while the URL parser folds any scheme casing (new URL("WSS://host") is valid). A configured WSS://host therefore falls into the plaintext branch and the derived HTTP base URL becomes http://host — silently downgrading TLS for that deployment (same for HTTPS://host → plain ws://).

Fix

Both raw-string scheme checks are case-folded before classification, so uppercase variants land in the secure branch like their lowercase equivalents.

Verification

  • Two new regression tests in bootstrap.test.ts (WSS:// and HTTPS:// configured URLs must resolve to https/wss targets); both fail against the old code and pass now.
  • Full environments/primary suite green, tsgo --noEmit clean.

ox-alpha via opencode

Note

Fix resolveConfiguredPrimaryTarget to treat uppercase HTTPS/WSS schemes as secure

When only one of VITE_HTTP_URL or VITE_WS_URL is set, the other is derived from it. Previously, uppercase secure schemes like HTTPS: or WSS: were not recognized as secure, causing the derived URL to downgrade to http or ws. The fix in target.ts normalizes the scheme via toLowerCase() before the security check. Tests in bootstrap.test.ts cover uppercase HTTPS and WSS env values.

Macroscope summarized 83fe887.


Note

Medium Risk
Touches how configured environment URLs are classified as TLS vs plaintext, which previously could silently downgrade derived http/ws bases. The change itself is a small, well-tested case-fold.

Overview
Stops a silent TLS downgrade when only one of VITE_HTTP_URL or VITE_WS_URL is set with an uppercase scheme (HTTPS:// / WSS://).

resolveConfiguredPrimaryTarget now case-folds the raw scheme before deciding whether to derive https/wss vs http/ws. Regression tests cover both uppercase env values resolving to secure targets.

Reviewed by Cursor Bugbot for commit 83fe887. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected handling of uppercase HTTPS and WSS URL schemes.
    • Secure connections now consistently remain on https and wss targets instead of being downgraded.

resolveConfiguredPrimaryTarget classified VITE_WS_URL/VITE_HTTP_URL
with case-sensitive startsWith checks while the URL parser accepts any
scheme casing. A configured "WSS://host" was therefore swapped to
plaintext http (and "HTTPS://host" to plaintext ws), silently
downgrading TLS for the affected base URL.

ox-alpha via opencode
@Lucenx9

Lucenx9 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Aug 23, 2026
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 13c108a1-3d96-4e26-ae39-293a2f3ee7f4

📥 Commits

Reviewing files that changed from the base of the PR and between b1670ac and 83fe887.

📒 Files selected for processing (2)
  • apps/web/src/environments/primary/bootstrap.test.ts
  • apps/web/src/environments/primary/target.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The target URL logic now normalizes configured schemes before detection. Tests cover uppercase WSS:// and HTTPS:// values and verify secure base URLs.

Changes

Secure scheme normalization

Layer / File(s) Summary
Normalize configured schemes and validate targets
apps/web/src/environments/primary/target.ts, apps/web/src/environments/primary/bootstrap.test.ts
Scheme checks now use lowercase values. Tests verify that uppercase WSS:// and HTTPS:// configurations produce secure HTTP and WebSocket base URLs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 83fe8

This localized change prevents uppercase HTTPS/WSS configuration values from being downgraded to insecure derived URLs, with regression tests covering both cases. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main fix for uppercase secure URL schemes.
Description check ✅ Passed The description explains the problem, fix, and verification, but it omits the template headings and checklist.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:XS 0-9 changed lines (additions + deletions). label Aug 23, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 83fe887591

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Lucenx9
Lucenx9 marked this pull request as ready for review August 23, 2026 15:06
Copilot AI lite review requested due to automatic review settings August 23, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Lucenx9

Lucenx9 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@macroscopeapp

macroscopeapp Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Skipped

Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

@maria-rcks
maria-rcks merged commit 69e5ad8 into pingdotgg:main Aug 23, 2026
28 checks passed
frankdavidcorona pushed a commit to frankdavidcorona/t3code that referenced this pull request Aug 23, 2026
…gdotgg#8005)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 24, 2026
## What's Changed
* fix(web): treat configured urls with uppercase schemes as secure by @Lucenx9 in pingdotgg/t3code#8005
* fix(desktop): keep release notes visible while downloading by @extoci in pingdotgg/t3code#6412


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260823.1171...v0.0.34-nightly.20260824.1172

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260824.1172
pandec added a commit to pandec/t3code that referenced this pull request Aug 24, 2026
Fast-forwards main from f70eeee to 7c6163c (16 commits, 65 files) and
merges it into dev. Small in commits, heavy in fork contact: 38 of those
files carried fork delta, but that produced only 7 conflicts across 9
hunks.

Upstream lands a redesigned skills menu behind a new showSkillsInSlashMenu
setting (pingdotgg#8009), Codex app access approval prompts (pingdotgg#8058), usage views
that hide providers with no usage (pingdotgg#7563), four timeline and tool-call
fixes (pingdotgg#7971, pingdotgg#8052, pingdotgg#7999, pingdotgg#8006), uppercase URL schemes treated as
secure (pingdotgg#8005), and a CI and Windows packaging speed pass (pingdotgg#7975).

Notable resolutions. Upstream's new slash-menu skill helpers auto-merged
reading raw selectedProviderStatus.skills. They now take the fork's
resolved effectiveProviderSkills, so the $ picker and the / menu still
agree about project-scoped skills on a thread whose cwd differs from the
server's. That same raw read has landed in a composer three syncs running
and compiles cleanly every time. ComposerCommandMenu keeps the fork's
Manual marker beside upstream's new source badge. ChatView.logic takes
upstream's MessageId but not the ProjectId it re-added, because the fork's
v2 storage key is scoped per environment. ChatView keeps its single
route-scoped visit selector and thread-keyed background stop while
adopting upstream's running-turn anchor release.

One thing to know about acceptAlways: it is a new persisted approval
decision, so an approval answered on this build does not decode on an
older one.

vp check, typecheck, and focused tests pass. The full suite is green with
no failures at all this time, PortScanner included. lint:mobile was
required because the @legendapp/list patch changed, and passes.

Reviewed and merged by Claude Opus 5 in Claude Code, with gpt-5.6-sol
subagents for the behavioral reviews and post-merge audits.
bcotrim pushed a commit to bcotrim/mognet that referenced this pull request Aug 24, 2026
…gdotgg#8005)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
(cherry picked from commit 69e5ad8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants