Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Backwards-incompatible change: renamed HttpResponse.headers to HttpRe…

…sponse._headers to deliberately break anyone accessing headers directly instead of through the case-insensitive proxies on HttpResponse itself. See BackwardsIncompatibleChanges for more details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dd799591fc9f6ab0d988e0dc82f47276bdab6b2a 1 parent 8cf9a6d
Jacob Kaplan-Moss authored September 14, 2007

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  django/http/__init__.py
12  django/http/__init__.py
@@ -246,7 +246,7 @@ def __init__(self, content='', mimetype=None, status=None,
246 246
         else:
247 247
             self._container = [content]
248 248
             self._is_string = True
249  
-        self.headers = {'content-type': content_type}
  249
+        self._headers = {'content-type': content_type}
250 250
         self.cookies = SimpleCookie()
251 251
         if status:
252 252
             self.status_code = status
@@ -254,24 +254,24 @@ def __init__(self, content='', mimetype=None, status=None,
254 254
     def __str__(self):
255 255
         "Full HTTP message, including headers"
256 256
         return '\n'.join(['%s: %s' % (key, value)
257  
-            for key, value in self.headers.items()]) \
  257
+            for key, value in self._headers.items()]) \
258 258
             + '\n\n' + self.content
259 259
 
260 260
     def __setitem__(self, header, value):
261  
-        self.headers[header.lower()] = value
  261
+        self._headers[header.lower()] = value
262 262
 
263 263
     def __delitem__(self, header):
264 264
         try:
265  
-            del self.headers[header.lower()]
  265
+            del self._headers[header.lower()]
266 266
         except KeyError:
267 267
             pass
268 268
 
269 269
     def __getitem__(self, header):
270  
-        return self.headers[header.lower()]
  270
+        return self._headers[header.lower()]
271 271
 
272 272
     def has_header(self, header):
273 273
         "Case-insensitive check for a header"
274  
-	return self.headers.has_key(header.lower())
  274
+        return self._headers.has_key(header.lower())
275 275
 
276 276
     __contains__ = has_header
277 277
 

0 notes on commit dd79959

Please sign in to comment.
Something went wrong with that request. Please try again.