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

Fix #588 don't fail if request.ip is missing #630

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

santib
Copy link
Collaborator

@santib santib commented Oct 16, 2023

From #588 we can see that if for some reason the request.ip is missing, rack-attack will try to do IPAddr.new(nil) which raises *** IPAddr::AddressFamilyError Exception: address family must be specified.

With this PR we only call IPAddr.new if we have a not empty string

@santib santib force-pushed the fix-588-missing-ip branch from 455ddcf to 3fcf9cf Compare October 16, 2023 21:15
Copy link
Collaborator

@grzuy grzuy left a comment

Choose a reason for hiding this comment

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

Thank you!

spec/acceptance/blocking_ip_spec.rb Show resolved Hide resolved
spec/acceptance/safelisting_ip_spec.rb Show resolved Hide resolved
@grzuy grzuy enabled auto-merge (squash) October 18, 2023 00:18
Copy link
Collaborator

@grzuy grzuy left a comment

Choose a reason for hiding this comment

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

👏

@grzuy grzuy merged commit 3543f61 into rack:main Oct 18, 2023
80 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.

2 participants