Django

Code

Changeset 6221

Show
Ignore:
Timestamp:
09/14/07 16:41:48 (1 year ago)
Author:
jacob
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/handlers/base.py

    r6219 r6221  
    143143    this function converts them to absolute paths. 
    144144    """ 
    145     if 'location' in response.headers and http.get_host(request): 
     145    if 'Location' in response and http.get_host(request): 
    146146        response['Location'] = request.build_absolute_uri(response['Location']) 
    147147    return response 
  • django/trunk/django/http/__init__.py

    r6212 r6221  
    274274        return self.headers.has_key(header.lower()) 
    275275 
     276    __contains__ = has_header 
     277 
    276278    def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None): 
    277279        self.cookies[key] = value