Fixed #407 -- Code no longer assumes request.META['REMOTE_ADDR'] exists. Thanks, sune.kirkeby@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-31 16:27:59 +00:00
parent abe7fb8173
commit cb6aa1035b
4 changed files with 5 additions and 5 deletions

View file

@ -17,6 +17,6 @@ def populate_xheaders(request, response, package, python_module_name, object_id)
within the INTERNAL_IPS setting.
"""
from django.conf.settings import INTERNAL_IPS
if request.META['REMOTE_ADDR'] in INTERNAL_IPS:
if request.META.get('REMOTE_ADDR') in INTERNAL_IPS:
response['X-Object-Type'] = "%s.%s" % (package, python_module_name)
response['X-Object-Id'] = str(object_id)