Merge branch 'python3' of git.dolda2000.com:/srv/git/r/wrw into python3
[wrw.git] / wrw / sp / xhtml.py
index 17c5678..5f1ca45 100644 (file)
@@ -53,9 +53,12 @@ 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):
         return forreq(req, callable(req))
+    wrapper.__wrapped__ = callable
     return wrapper