Skip to content

Conversation

@frollow
Copy link
Owner

@frollow frollow commented Jan 4, 2026

No description provided.

@frollow frollow merged commit 993321a into master Jan 4, 2026
2 checks passed
@chatgpt-codex-connector
Copy link

💡 Codex Review

header_name = getattr(settings, "ADS_THROTTLE_IP_HEADER", "")
header_name = header_name.strip().upper().replace("-", "_")
if header_name:
custom_ip = request.META.get(f"HTTP_{header_name}")
if custom_ip:
return custom_ip.strip()

P2 Badge Parse X-Forwarded-For lists in custom IP header

When ADS_THROTTLE_IP_HEADER is set to X-Forwarded-For (the docs explicitly suggest this), _get_client_ip returns the entire header string (e.g., "1.1.1.1, 2.2.2.2") without splitting it. That full list is then used in the viewer fingerprint and _hash_ip, so overrides keyed by raw client IP won’t match and throttling decisions will vary with proxy chain ordering. This only shows up when the custom header contains multiple IPs, which is the standard X-Forwarded-For format; consider splitting on comma the same way the default path does.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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