]> www.dolda2000.com Git - wrw.git/commitdiff
Add Content-Length to SP responses.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 23:10:23 +0000 (01:10 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 23:10:23 +0000 (01:10 +0200)
wrw/sp/util.py

index 3ea7a8aa91d6133321cf640da735ca87d5d1588c..e15b9471e1c5c681d9b6585670c8444884f1d7f6 100644 (file)
@@ -234,5 +234,7 @@ class response(dispatch.restart):
         raise Exception("a subclass of wrw.sp.util.response must override ctype")
 
     def handle(self, req):
+        ret = self.formatter.format(self.root, doctype=self.doctype, charset=self.charset)
         req.ohead["Content-Type"] = self.ctype
-        return [self.formatter.format(self.root, doctype=self.doctype, charset=self.charset)]
+        req.ohead["Content-Length"] = len(ret)
+        return [ret]