From 5ce2e6c2c827cf877f73bf0e42e6afb7e6a71ccf Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 15 Sep 2007 21:42:51 +0000 Subject: queryset-refactor: Merged to [6220] git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6337 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/http/__init__.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'django/http') diff --git a/django/http/__init__.py b/django/http/__init__.py index 2b68a6243a..1bb1621d77 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -246,7 +246,7 @@ class HttpResponse(object): else: self._container = [content] self._is_string = True - self.headers = {'Content-Type': content_type} + self.headers = {'content-type': content_type} self.cookies = SimpleCookie() if status: self.status_code = status @@ -258,24 +258,20 @@ class HttpResponse(object): + '\n\n' + self.content def __setitem__(self, header, value): - self.headers[header] = value + self.headers[header.lower()] = value def __delitem__(self, header): try: - del self.headers[header] + del self.headers[header.lower()] except KeyError: pass def __getitem__(self, header): - return self.headers[header] + return self.headers[header.lower()] def has_header(self, header): "Case-insensitive check for a header" - header = header.lower() - for key in self.headers.keys(): - if key.lower() == header: - return True - return False + return self.headers.has_key(header.lower()) def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None): self.cookies[key] = value @@ -304,7 +300,7 @@ class HttpResponse(object): content = property(_get_content, _set_content) def __iter__(self): - self._iterator = self._container.__iter__() + self._iterator = iter(self._container) return self def next(self): -- cgit v1.3