]> git.dolda2000.com Git - wrw.git/commitdiff
Set Content-Length in a couple of places.
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 5 Jun 2013 10:58:02 +0000 (12:58 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 5 Jun 2013 10:58:02 +0000 (12:58 +0200)
wrw/resp.py
wrw/sp/xhtml.py

index 24896bab3b0512bfef2cf7c408586fa41caffbaa..a27a143f1b04abb60517ae65455a90538237a8bf 100644 (file)
@@ -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 []
index 3c6c0f6898333ae89a28bc01b5a106fa17325b05..d19fc99a0b4bf33618906d635cb5e0c80505b6a3 100644 (file)
@@ -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):