Skip to content

Commit

Permalink
Handle multiple ip addresses in mezzanine.utils.views.ip_for_request.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Jan 22, 2014
1 parent 303cc94 commit 9f8a125
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mezzanine/utils/views.py
Expand Up @@ -47,7 +47,7 @@ def ip_for_request(request):
header, since app will generally be behind a public web server.
"""
meta = request.META
return meta.get("HTTP_X_FORWARDED_FOR", meta["REMOTE_ADDR"])
return meta.get("HTTP_X_FORWARDED_FOR", meta["REMOTE_ADDR"]).split(",")[0]


def is_spam_akismet(request, form, url):
Expand Down

0 comments on commit 9f8a125

Please sign in to comment.