Django

Code

Show
Ignore:
Timestamp:
11/10/07 21:55:44 (1 year ago)
Author:
mtredinnick
Message:

Fixed #5898 -- Changed a few response processing paths to make things harder to get wrong and easier to get right. Previous behaviour wasn't buggy, but it was harder to use than necessary.

We now have automatic HEAD processing always (previously required ConditionalGetMiddleware?), middleware benefits from the Location header rewrite, so they can use relative URLs as well, and responses with response codes 1xx, 204 or 304 will always have their content removed, in accordance with the HTTP spec (so it's much harder to indavertently deliver invalid responses).

Based on a patch and diagnosis from regexbot@gmail.com.

Files:

Legend:

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

    r6592 r6662  
    208208                for middleware_method in self._response_middleware: 
    209209                    response = middleware_method(request, response) 
     210                response = self.apply_response_fixes(request, response) 
    210211        finally: 
    211212            dispatcher.send(signal=signals.request_finished) 
     
    221222        start_response(status, response_headers) 
    222223        return response 
     224