Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dig method case-insensitive in Faraday::Utils::Headers #1557

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

vitali-semenyuk
Copy link
Contributor

Description

Adds #dig method to Faraday::Utils::Headers to keep Hash access methods consistent

Fixes #1556

Todos

List any remaining work that needs to be done, i.e:

  • Tests
  • Documentation

it { expect(subject&.dig('Content-Type')).to eq('application/json') }
it { expect(subject&.dig('CONTENT-TYPE')).to eq('application/json') }
it { expect(subject&.dig(:content_type)).to eq('application/json') }
it { expect(subject&.dig('invalid')).to be_nil }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The safe-navigation operator is not needed here.

(The use of the subject dynamic definition's superfluous, too, but make no changes to that in this PR.)

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

♥️ 💛 💚 💙 💜

@olleolleolle olleolleolle merged commit c9cc1b3 into lostisland:main Apr 2, 2024
7 checks passed
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.

Case Insensitivity Issue with #dig Method on Response Headers
2 participants