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

Support for proxies and load balancers #66

Merged
merged 2 commits into from
May 29, 2014
Merged

Conversation

spudstuff
Copy link

Combine both the REMOTE_ADDR header (which is the connecting device's IP address), plus the HTTP_X_FORWARDED_FOR header if present (which is set by some proxy servers and load balancers) when determining the user's IP address. This allows us to have a unique per-user view, even when behind a proxy or load balancer.

… IP address), plus the HTTP_X_FORWARDED_FOR header if present (which is set by some proxy servers and load balancers). This allows us to have a unique per-user view, even when behind a proxy or load balancer.
@yellis
Copy link
Member

yellis commented May 29, 2014

I like the idea, though in cases where request.ServerVariables["HTTP_X_FORWARDED_FOR"] is not set, no reason to include the extra comma and space (ie: in that case would make sense to just return request.ServerVariables[""REMOTE_ADDR""] as was done before.

Also, might be better (for readability) to separate by [space][dash][space] rather than [comma][space].

@spudstuff
Copy link
Author

@yellis - no problem at all. New commit added. Cheers.

yellis added a commit that referenced this pull request May 29, 2014
Support for proxies and load balancers
@yellis yellis merged commit adedd07 into MiniProfiler:master May 29, 2014
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