From 6bb05fa8ed1a7ea1c369e0cab9a1269eb06a4211 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 16 Sep 2013 01:10:23 +0200 Subject: [PATCH] Add Content-Length to SP responses. --- wrw/sp/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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] -- 2.11.0