#5898: HeadMiddleware - Modify response for HEAD requests
--------------------------------------------------------+-------------------
   Reporter:  Scott Barr <[EMAIL PROTECTED]>  |                Owner:  nobody   
    
     Status:  reopened                                  |            Component: 
 HTTP handling
    Version:  SVN                                       |           Resolution: 
              
   Keywords:                                            |                Stage: 
 Unreviewed   
  Has_patch:  1                                         |           Needs_docs: 
 0            
Needs_tests:  0                                         |   Needs_better_patch: 
 0            
--------------------------------------------------------+-------------------
Changes (by arien <[EMAIL PROTECTED]>):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 I think the point is that the conditional get middleware should not do
 this.

 HEAD requests must not return content the same way that Location headers
 must use absolute URIs, which is what
 
[http://code.djangoproject.com/browser/django/trunk/django/core/handlers/base.py
 django.core.handlers.base.fix_location_header] tries to ensure.  When I
 tried to come up with a better patch for this issue, I found out
 fix_location_header fails, because fix_location_header fails is called (in
 the handler's get_response) '''before''' the response middleware is run.

 The problem here is similar: this code should run '''after''' all response
 middleware, but there's not a really good place for it to hook into.  If
 there were such a place both these issues could be easily resolved.

 Since, there is no such hook, I'll attach a patch to show what this would
 mean for this responses to HEAD requests, written as a response middleware
 that would always run after all other response middleware.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5898#comment:5>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to