Permalink
Browse files

Still messing with middleware.

  • Loading branch information...
1 parent aeda83f commit 088354c1c3c95570f37f5bf5df7e27934958a00c @anthonydb committed Mar 4, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 middleware.py
View
@@ -6,3 +6,7 @@ def process_request(self, request):
if 'HTTP_X_FORWARDED_FOR' in request.META:
ip = request.META['HTTP_X_FORWARDED_FOR'].split(",")[0].strip()
request.META['REMOTE_ADDR'] = ip
+
+ if 'HTTP_HOST' in request.META:
+ host = request.META['HTTP_HOST'].split(",")[0].strip()
+ request.META['REMOTE_HOST'] = host

0 comments on commit 088354c

Please sign in to comment.