Skip to content

Clear the header name index with the headers - #1697

Closed
OskarEichler wants to merge 0 commit into
lostisland:mainfrom
OskarEichler:codex/clear-header-name-index
Closed

OskarEichler wants to merge 0 commit into
lostisland:mainfrom
OskarEichler:codex/clear-header-name-index

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

Clear the header name index together with the Hash.

Reproduction and verification

After Headers.new('X-Demo'=>'one').clear, key?('x-demo') remains true before the fix, and reinsertion inherits removed spelling. Fixed clear returns self, removes membership and lets the next insertion establish its spelling. Related #376 covered replace only.

  • Individual patch: 6 focused Faraday checks passed (clear); 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

No new API; removed header spellings no longer survive clear.

@OskarEichler
OskarEichler force-pushed the codex/clear-header-name-index branch from 6d017e3 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