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