[Zope-CVS] CVS: Products/PluggableAuthService/plugins - InlineAuthHelper.py:1.1.2.2

Zachery Bir zbir at urbanape.com
Fri Oct 15 10:45:37 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService/plugins
In directory cvs.zope.org:/tmp/cvs-serv28017

Modified Files:
      Tag: pre-1_0_3-zbir-challenge-branch
	InlineAuthHelper.py 
Log Message:
Use response.setBody() instead of response.write(), but override
response.setBody afterwards to keep exception from stomping on it
later.


=== Products/PluggableAuthService/plugins/InlineAuthHelper.py 1.1.2.1 => 1.1.2.2 ===
--- Products/PluggableAuthService/plugins/InlineAuthHelper.py:1.1.2.1	Thu Oct 14 12:07:14 2004
+++ Products/PluggableAuthService/plugins/InlineAuthHelper.py	Fri Oct 15 10:45:37 2004
@@ -104,8 +104,19 @@
     security.declarePrivate('challenge')
     def challenge(self, request, response, **kw):
         """ Challenge the user for credentials. """
-        response.write(self.body)
+        response.setStatus('200')
+        response.setBody(self.body)
+
+        # Keep HTTPResponse.exception() from further writing on the
+        # response body, without using HTTPResponse.write()
+        response._locked_status = True
+        response.setBody = self._setBody # Keep response.exception
         return True
+
+    # Methods to override on response
+
+    def _setBody(self, body, *args, **kw):
+        pass
 
 InitializeClass(InlineAuthHelper)
 



More information about the Zope-CVS mailing list