Skip to content

fix(bruno-response): normalize response header name lookup to be case-insensitive#8461

Open
abhishekp-bruno wants to merge 1 commit into
usebruno:mainfrom
abhishekp-bruno:feat/make-header-lookup-case-insensitive
Open

fix(bruno-response): normalize response header name lookup to be case-insensitive#8461
abhishekp-bruno wants to merge 1 commit into
usebruno:mainfrom
abhishekp-bruno:feat/make-header-lookup-case-insensitive

Conversation

@abhishekp-bruno

@abhishekp-bruno abhishekp-bruno commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

res.getHeader(name) is now case-insensitive to ensure header lookups work regardless of the casing used in the header name.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • Bug Fixes
    • Header lookups are now case-insensitive, so header values are retrieved consistently regardless of letter casing.
    • Added automated tests covering mixed-case queries, array-valued headers, and missing headers to prevent regressions.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

BrunoResponse#getHeader now lowercases requested header names before lookup. A Jest spec covers mixed-case retrieval, array-valued headers, and missing headers.

Changes

Header lookup fix

Layer / File(s) Summary
Case-insensitive header lookup
packages/bruno-js/src/bruno-response.js, packages/bruno-js/tests/bruno-response-get-header.spec.js
getHeader lowercases the input name before indexing headers; tests cover mixed-case lookup, array-valued headers, and missing headers.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: bijin-bruno

Poem

Headers shed their case,
Cookies keep their array shape,
Missing ones return—
A tiny lookup change blooms,
Tests mark the path.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making response header lookup case-insensitive.
✨ 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.

@abhishekp-bruno
abhishekp-bruno force-pushed the feat/make-header-lookup-case-insensitive branch from 9d2131b to 92d94c4 Compare July 16, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant