From: Fredrik Tolf Date: Sun, 15 Sep 2013 23:10:23 +0000 (+0200) Subject: Add Content-Length to SP responses. X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=6bb05fa8ed1a7ea1c369e0cab9a1269eb06a4211 Add Content-Length to SP responses. --- diff --git a/wrw/sp/util.py b/wrw/sp/util.py index 3ea7a8a..e15b947 100644 --- a/wrw/sp/util.py +++ b/wrw/sp/util.py @@ -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]