Skip to content

fix: use resolve headers in Context.headers fallback#1798

Open
MegaManSec wants to merge 1 commit intoelysiajs:mainfrom
MegaManSec:j7
Open

fix: use resolve headers in Context.headers fallback#1798
MegaManSec wants to merge 1 commit intoelysiajs:mainfrom
MegaManSec:j7

Conversation

@MegaManSec
Copy link
Contributor

@MegaManSec MegaManSec commented Mar 10, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed type checking for request headers configuration to correctly validate header definitions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98f9df70-ed27-4298-81d3-87250d112675

📥 Commits

Reviewing files that changed from the base of the PR and between 169e54a and aac91aa.

📒 Files selected for processing (1)
  • src/context.ts

Walkthrough

A single-line type definition correction in the Context type, changing the conditional check for the headers property from incorrectly referencing Singleton['resolve']['query'] to the correct Singleton['resolve']['headers'].

Changes

Cohort / File(s) Summary
Type Definition Fix
src/context.ts
Fixed the conditional type check for the headers property in the Context type. Changed from checking NonNullable<Singleton['resolve']['query']> to NonNullable<Singleton['resolve']['headers']>, ensuring the correct branch is evaluated for header type resolution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny typo in the types we see,
Query became headers—oops, wasn't meant to be!
One line fixed, the logic now true,
Headers resolve just as they should do! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a conditional check in Context.headers to use resolve headers instead of resolve query.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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