Skip to content

Normalize header membership checks and verify current entries - #1696

Closed
OskarEichler wants to merge 0 commit into
lostisland:mainfrom
OskarEichler:codex/normalize-header-membership-checks
Closed

OskarEichler wants to merge 0 commit into
lostisland:mainfrom
OskarEichler:codex/normalize-header-membership-checks

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

Normalize membership keys and check the currently stored header entry.

Reproduction and verification

Headers.new(user_agent: 'demo').key?(:user_agent) is false before the fix. After delete_if removes the entry, key?('user-agent') incorrectly remains true. The fix corrects both; all four predicate aliases and nil/false values are covered.

  • Individual patch: 24 focused Faraday checks passed (membership); all 639 existing RSpec examples pass; changed-file RuboCop and Ruby syntax pass.
  • Combined installed-release-based branch: 639 existing examples, 1,124 focused checks, full RuboCop (75 files), YARD checks and gem packaging pass.
  • External faraday-net_http adapter suite: 386 existing examples, zero failures with the combined fixes.
  • Ruby 4.0.6 through rbenv. No production or live external HTTP operations.

Limitations

No test/spec files were added or changed because the originating repository explicitly forbids this. Reproductions ran outside the repository. This differs from Faraday's requested regression-test contribution convention and is disclosed for maintainer review. Other Ruby versions/platforms were not run locally. This PR includes only the focused source change; the other fixes and the consumer's separately verified merged JSON decoder patch #1687 are not added here.

Breaking-change notes

Predicates now agree with current normalized entries. This does not redesign all inherited Hash mutation APIs.

@OskarEichler
OskarEichler force-pushed the codex/normalize-header-membership-checks branch from ccfe66b to b25b1b2 Compare August 28, 2026 11:12

This branch was previously deployed

1 inactive deployment
github-pages — b25b1b26 Deployed Aug 12, 2026 by olleolleolle via deploy #223
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