Index: http.py
===================================================================
--- http.py	(revision 6635)
+++ http.py	(working copy)
@@ -57,3 +57,21 @@
             # client's IP will be the first one.
             real_ip = real_ip.split(",")[0].strip()
             request.META['REMOTE_ADDR'] = real_ip
+
+class HeadMiddleware(object):
+    """ Make a sensible HEAD response """
+
+    def process_response(self, request, response):
+        """
+        If the request method is HEAD and the response is 200 OK, set the 
+        'Content-Length' header, and remove the content body.
+        
+        It is expected that CommonMiddleware has already processed the response
+        and added the Content-Length header, which is desirable in the response
+        to a HEAD request.
+        """
+        if request.method == 'HEAD':
+            # remove the content
+            response.content = ''
+
+        return response
