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.
+        """
+        if request.method == 'HEAD':
+            # set the Content-Length header if not already set
+            if not response.has_header('Content-Length'):
+                response['Content-Length'] = str(len(response.content))
+
+            # remove the content
+            response.content = ''
+
+        return response
