Merge branch 'master' into python3
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 5 Jun 2013 10:58:21 +0000 (12:58 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 5 Jun 2013 10:58:21 +0000 (12:58 +0200)
1  2 
wrw/resp.py
wrw/sp/xhtml.py

diff --cc wrw/resp.py
Simple merge
diff --cc wrw/sp/xhtml.py
@@@ -51,9 -51,11 +51,11 @@@ class htmlindenter(util.indenter, htmlf
  def forreq(req, tree):
      # XXX: Use proper Content-Type for clients accepting it.
      req.ohead["Content-Type"] = "text/html; charset=utf-8"
 -    buf = StringIO.StringIO()
 +    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):