From: Fredrik Tolf Date: Wed, 5 Jun 2013 10:58:21 +0000 (+0200) Subject: Merge branch 'master' into python3 X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=3b67497cb853ea7dd49f579566e5f0b60a3c97d7;hp=fd7af0a278cf6a58b8ea371e3e84c99c1cb77e0c Merge branch 'master' into python3 --- diff --git a/wrw/resp.py b/wrw/resp.py index b62ce0e..bdceb90 100644 --- a/wrw/resp.py +++ b/wrw/resp.py @@ -70,4 +70,5 @@ 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 [] diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 17c5678..52e7f9f 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 = io.BytesIO() 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):