Django

Code

Changeset 181

Show
Ignore:
Timestamp:
07/18/05 15:14:05 (3 years ago)
Author:
adrian
Message:

Changed core.handlers.modpython.populate_apache_request NOT to have side effects on http_response. This has no effect on legacy code but will prevent problems in new code

Files:

Legend:

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

    r169 r181  
    267267    "Populates the mod_python request object with an HttpResponse" 
    268268    mod_python_req.content_type = http_response['Content-Type'] or httpwrappers.DEFAULT_MIME_TYPE 
    269     del http_response['Content-Type'] 
    270269    if http_response.cookies: 
    271270        mod_python_req.headers_out['Set-Cookie'] = http_response.cookies.output(header='') 
    272271    for key, value in http_response.headers.items(): 
    273         mod_python_req.headers_out[key] = value 
     272        if key != 'Content-Type': 
     273            mod_python_req.headers_out[key] = value 
    274274    mod_python_req.status = http_response.status_code 
    275275    mod_python_req.write(http_response.get_content_as_string('utf-8'))