From: Fredrik Tolf Date: Wed, 5 Jun 2013 10:59:12 +0000 (+0200) Subject: Merge branch 'master' of git.dolda2000.com:/srv/git/r/wrw X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=7756066bff7ee01d615cbce0d5ddd58441108bd6;hp=98cc090c6a4c3d87e5ee411c056e60f17da31e76 Merge branch 'master' of git.dolda2000.com:/srv/git/r/wrw --- diff --git a/wrw/resp.py b/wrw/resp.py index e901988..50ac6b1 100644 --- a/wrw/resp.py +++ b/wrw/resp.py @@ -70,6 +70,7 @@ class redirect(dispatch.restart): def handle(self, req): req.status(self.status, "Redirect") req.ohead["Location"] = proto.appendurl(proto.requrl(req), self.url) + req.ohead["Content-Length"] = 0 return [] class unmodified(dispatch.restart): diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 447c1b1..e78d197 100644 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@ -53,7 +53,9 @@ def forreq(req, tree): req.ohead["Content-Type"] = "text/html; charset=utf-8" buf = StringIO.StringIO() htmlindenter.output(buf, tree, doctype=(doctype, dtd), charset="utf-8") - return [buf.getvalue()] + ret = buf.getvalue() + req.ohead["Content-Length"] = len(ret) + return [ret] def xhtmlresp(callable): def wrapper(req):