1. django
  2. django


ja...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed e4f2c0a

Fixed the breakage in [6164] in a different, better way: HttpResponse now implements __contains__ along with __get/set/delitem__, as it should. This is a bit more robust, and should prevent similar breakage from user code.

  • Participants
  • Parent commits 17e34c2
  • Branches default

Comments (0)

Files changed (2)

File django/core/handlers/base.py

View file
  • Ignore whitespace
     Code constructing response objects is free to insert relative paths and
     this function converts them to absolute paths.
-    if 'location' in response.headers and http.get_host(request):
+    if 'Location' in response and http.get_host(request):
         response['Location'] = request.build_absolute_uri(response['Location'])
     return response

File django/http/__init__.py

View file
  • Ignore whitespace
         "Case-insensitive check for a header"
 	return self.headers.has_key(header.lower())
+    __contains__ = has_header
     def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None):
         self.cookies[key] = value
         for var in ('max_age', 'path', 'domain', 'secure', 'expires'):