You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by jg...@apache.org on 2006/01/11 00:03:13 UTC

svn commit: r367825 - /httpd/mod_python/trunk/lib/python/mod_python/publisher.py

Author: jgallacher
Date: Tue Jan 10 15:03:11 2006
New Revision: 367825

URL: http://svn.apache.org/viewcvs?rev=367825&view=rev
Log:
Reverted publisher.publish_object behaviour to write result even if
even if req.method == 'HEAD'.
Ref MODPYTHON-105

Modified:
    httpd/mod_python/trunk/lib/python/mod_python/publisher.py

Modified: httpd/mod_python/trunk/lib/python/mod_python/publisher.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/publisher.py?rev=367825&r1=367824&r2=367825&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/publisher.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/publisher.py Tue Jan 10 15:03:11 2006
@@ -462,11 +462,11 @@
             if charset is not None:
                 req.content_type += '; charset=%s'%charset
         
-        if req.method!='HEAD':
-            
-            # TODO : the problem is that a handler can still use req.write
-            # and break the assumption that nothing should be written with the
-            # HEAD method.
-            req.write(result)
+        # Write result even if req.method == 'HEAD'
+        # Apache will truncate the output if necessary.
+        # Truncating output here if req.method is HEAD is likely the 
+        # wrong thing to do # as it may cause problems for any output filters.
+        # See MODPYTHON-105 for details.
+        req.write(result)
 
         return True