Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python_ipware/python_ipware.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def __init__(
# Default precedence list of headers if none is provided
if precedence is None:
precedence = (
"TRUE-CLIENT-IP", # Header for CloudFlare Enterprise.
"HTTP_CF_CONNECTING_IP", # Used by CloudFlare.
"CF-CONNECTING-IP", # Used by CloudFlare.
"X_FORWARDED_FOR", # Common header for proxies, load balancers, like AWS ELB. Default to the left-most IP.
"HTTP_X_FORWARDED_FOR", # Alternative header similar to `X_FORWARDED_FOR`.
"HTTP_CLIENT_IP", # Header used by some providers like Amazon EC2, Heroku.
Expand All @@ -37,14 +40,11 @@ def __init__(
"HTTP_X_CLUSTER_CLIENT_IP", # Used by Rackspace LB, Riverbed Stingray.
"HTTP_FORWARDED_FOR", # Standard header defined by RFC 7239.
"HTTP_FORWARDED", # Standard header defined by RFC 7239.
"HTTP_CF_CONNECTING_IP", # Used by CloudFlare.
"X-CLIENT-IP", # Used by Microsoft Azure.
"X-REAL-IP", # Commonly used by NGINX.
"X-CLUSTER-CLIENT-IP", # Used by Rackspace Cloud Load Balancers.
"X_FORWARDED", # Used by Squid.
"FORWARDED_FOR", # Standard header defined by RFC 7239.
"CF-CONNECTING-IP", # Used by CloudFlare.
"TRUE-CLIENT-IP", # Header for CloudFlare Enterprise.
"FASTLY-CLIENT-IP", # Used by Fastly, Firebase.
"FORWARDED", # Standard header defined by RFC 7239.
"CLIENT-IP", # Used by Akamai, Cloudflare's True-Client-IP, and Fastly's Fastly-Client-IP.
Expand Down