Skip to content

Fix IP-based request blocking for large page numbers #7434

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

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 2, 2023

#7364 was a bit too eager to remove the X-Real-Ip header from nginx. As it turns out the header was/is still used in two places in our codebase, but the lowercase header value did not show up in my code search back then… 🙈

Anyway, this PR fixes the IP-based request blocking use-case for large page numbers by using the RealIp request extension that was introduced in #7432.

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-backend ⚙️ labels Nov 2, 2023
if config
.page_offset_cidr_blocklist
.iter()
.any(|blocked| blocked.contains(client_ip))
.any(|blocked| blocked.contains(**client_ip))
Copy link
Contributor

Choose a reason for hiding this comment

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

And here I thought I'd left asterisk combinations back in my C days.

@Turbo87 Turbo87 merged commit 078bfc9 into rust-lang:main Nov 2, 2023
@Turbo87 Turbo87 deleted the fix-pagination-ip-blocking branch November 2, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants