Skip to content

fix(web-incoming): use isSSL regex for consistent https/wss protocol checks#123

Merged
pi0 merged 2 commits intomainfrom
fix/https-protocol-checks
Mar 25, 2026
Merged

fix(web-incoming): use isSSL regex for consistent https/wss protocol checks#123
pi0 merged 2 commits intomainfrom
fix/https-protocol-checks

Conversation

@pi0
Copy link
Copy Markdown
Member

@pi0 pi0 commented Mar 25, 2026

Summary

  • Upstream: adjust web-icoming handling of https protocol checks http-party/node-http-proxy#1419
  • The forward, target, and followRedirects code paths in web-incoming.ts used === "https:" to decide between http and https agents
  • This missed wss: and other SSL protocol variants, causing them to incorrectly use plain HTTP
  • The rest of the codebase (_utils.ts, ws-incoming.ts, ws.ts) already uses the shared isSSL regex — this aligns the three remaining call sites

Test plan

  • All 265 existing tests pass
  • Consistent with isSSL usage in _utils.ts:55, _utils.ts:103, ws-incoming.ts:86, ws.ts:143

…l checks

Upstream: http-party/node-http-proxy#1419
The forward, target, and redirect code paths used `=== "https:"` which
missed `wss:` and other SSL protocol variants. The rest of the codebase
already uses the shared `isSSL` regex — align these three call sites.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

Warning

Rate limit exceeded

@pi0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 598f9977-03b2-4a4f-a089-d502e977df2c

📥 Commits

Reviewing files that changed from the base of the PR and between 743abaa and 538499b.

📒 Files selected for processing (1)
  • src/middleware/web-incoming.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/https-protocol-checks

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 and usage tips.

Comment thread src/index.ts Outdated
@pi0 pi0 merged commit f8d5a0a into main Mar 25, 2026
5 checks passed
@pi0 pi0 deleted the fix/https-protocol-checks branch March 25, 2026 20:33
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.41%. Comparing base (d65b3f7) to head (538499b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
+ Coverage   96.15%   96.41%   +0.25%     
==========================================
  Files           8        8              
  Lines         651      698      +47     
  Branches      245      277      +32     
==========================================
+ Hits          626      673      +47     
  Misses         24       24              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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