Skip to content

fix(ab-test): extract client IP from x-forwarded-for header#17612

Merged
pettinarip merged 1 commit into
masterfrom
fix/ab-test-fingerprint
Feb 21, 2026
Merged

fix(ab-test): extract client IP from x-forwarded-for header#17612
pettinarip merged 1 commit into
masterfrom
fix/ab-test-fingerprint

Conversation

@pettinarip
Copy link
Copy Markdown
Member

Summary

Fixes non-deterministic A/B test variant assignment caused by the Cloudflare proxy layer.

Problem: The x-forwarded-for header contains a comma-separated list of IPs: "client_ip, proxy1, proxy2, cdn_edge". With Cloudflare in front, the proxy IPs change between requests (different edge nodes handle different requests), causing different fingerprints and non-deterministic variant assignment for the same user.

Fix: Extract only the first IP (the actual client IP) for stable fingerprinting.

Test plan

  • Verified in production with debug logging that client IP is now stable across requests
  • Confirmed variant assignment is deterministic after the fix

The x-forwarded-for header contains a comma-separated list of IPs:
"client_ip, proxy1, proxy2, cdn_edge". With Cloudflare in front,
the proxy IPs change between requests causing different fingerprints
and non-deterministic variant assignment.

Fix: Extract only the first IP (the actual client) for stable fingerprinting.
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 21, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit e68ebfe
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/69996a5587ed460008904d5a
😎 Deploy Preview https://deploy-preview-17612.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 60 (🟢 up 5 from production)
Accessibility: 94 (no change from production)
Best Practices: 100 (no change from production)
SEO: 99 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the tooling 🔧 Changes related to tooling of the project label Feb 21, 2026
@pettinarip pettinarip merged commit dde1b3a into master Feb 21, 2026
16 checks passed
@pettinarip pettinarip deleted the fix/ab-test-fingerprint branch February 21, 2026 09:26
@pettinarip pettinarip mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant