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

net-http: Allow symbol based hashes for headers #1750

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

ThisGuyCodes
Copy link
Contributor

These methods work fine with headers given as Hash[Symbol, untyped]. I noticed when I got some squiggly lines in some of my methods that I already know work. I also defined headers as a type alias rather than copy-pasting the same definition everywhere (I can undo this if not desired).

I did (Hash[String, untyped] | Hash[Symbol, untyped]) rather than Hash[String | Symbol, untyped] because hashes with mixed key types can allow name collisions which gives unexpected behavior.

I also feel like we can do better than untyped for the values, but leaving it for now.

These methods work fine with headers given as `Hash[Symbol, untyped]`. I noticed when I got some squiggly lines in some of my methods that I already know work. I also defined `headers` as a type alias rather than copy-pasting the same definition everywhere (I can undo this if not desired).

I did `(Hash[String, untyped] | Hash[Symbol, untyped])` rather than `Hash[String | Symbol, untyped]` because hashes with mixed key types can allow name collisions which gives unexpected behavior.

I also feel like we can do better than `untyped` for the values, but leaving it for now.
@ThisGuyCodes ThisGuyCodes changed the title Allow symbol based hashes for headers net-http Allow symbol based hashes for headers Feb 7, 2024
@ThisGuyCodes ThisGuyCodes changed the title net-http Allow symbol based hashes for headers net-http: Allow symbol based hashes for headers Feb 7, 2024
@soutaro soutaro enabled auto-merge March 22, 2024 03:22
@soutaro soutaro added this to the RBS 3.5 milestone Mar 22, 2024
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks!

@soutaro soutaro added this pull request to the merge queue Mar 22, 2024
Merged via the queue into ruby:master with commit 78effe5 Mar 22, 2024
17 checks passed
@ThisGuyCodes ThisGuyCodes deleted the patch-2 branch March 22, 2024 03:32
@soutaro soutaro added the Released PRs already included in the released version label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants