Fix #150. DataError, REMOTE_ADDR is b''. (#216)

This commit is contained in:
cryptogun 2017-11-04 21:14:40 +08:00 committed by Esteban Castro Borsani
parent 446adee597
commit c9c16653e6

View File

@ -16,8 +16,7 @@ from .conf import settings
class XForwardedForMiddleware(MiddlewareMixin):
def process_request(self, request):
if not settings.DEBUG:
request.META['REMOTE_ADDR'] = request.META['HTTP_X_FORWARDED_FOR'].split(",")[-1].strip()
request.META['REMOTE_ADDR'] = request.META['HTTP_X_FORWARDED_FOR'].split(",")[-1].strip()
class PrivateForumMiddleware(MiddlewareMixin):