Skip to content

fix(web-outgoing): skip empty header names#121

Merged
pi0 merged 1 commit intomainfrom
fix/empty-header-name
Mar 25, 2026
Merged

fix(web-outgoing): skip empty header names#121
pi0 merged 1 commit intomainfrom
fix/empty-header-name

Conversation

@pi0
Copy link
Copy Markdown
Member

@pi0 pi0 commented Mar 25, 2026

Summary

  • Add explicit guard to skip empty/whitespace-only header keys in writeHeaders middleware, preventing ERR_INVALID_HTTP_TOKEN crashes
  • While the existing try/catch already caught this error, the explicit check avoids relying on exception-based control flow for expected cases
  • Upstream reference: header could be empty string http-party/node-http-proxy#1551

Test plan

  • Added regression test skips empty header names (upstream#1551) with mock setHeader that throws for invalid tokens
  • Full test suite passes (245 tests)

…P_TOKEN

add explicit guard for empty/whitespace-only header keys in writeHeaders
(upstream http-party/node-http-proxy#1551)
@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 14 minutes and 8 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: db432a10-50b7-4be0-be6b-b29caf569090

📥 Commits

Reviewing files that changed from the base of the PR and between f30f90f and de0c83f.

📒 Files selected for processing (2)
  • src/middleware/web-outgoing.ts
  • test/middleware/web-outgoing.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/empty-header-name

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.

@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.12%. Comparing base (f30f90f) to head (de0c83f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage   96.12%   96.12%           
=======================================
  Files           8        8           
  Lines         645      645           
  Branches      243      243           
=======================================
  Hits          620      620           
  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.

@pi0 pi0 merged commit d8be0d8 into main Mar 25, 2026
7 checks passed
@pi0 pi0 deleted the fix/empty-header-name branch March 25, 2026 20:28
@pi0 pi0 mentioned this pull request Mar 25, 2026
58 tasks
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