[Zope3-checkins] SVN: Zope3/branches/srichter-twisted-integration/src/zope/publisher/http.py Added back the setting of the principal string; but this time not via this

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Apr 20 13:02:20 EDT 2005


Log message for revision 30064:
  Added back the setting of the principal string; but this time not via this 
  horrific HTTP Task hack, but as a response header. Smart servers with 
  smart loggers will understand this. :-) (Note: The Zope 3 and Twisted team 
  might agree on a more neutral term though, which we will suggest being 
  placed into the WSGI standard.)
  
  

Changed:
  U   Zope3/branches/srichter-twisted-integration/src/zope/publisher/http.py

-=-
Modified: Zope3/branches/srichter-twisted-integration/src/zope/publisher/http.py
===================================================================
--- Zope3/branches/srichter-twisted-integration/src/zope/publisher/http.py	2005-04-20 16:58:01 UTC (rev 30063)
+++ Zope3/branches/srichter-twisted-integration/src/zope/publisher/http.py	2005-04-20 17:02:20 UTC (rev 30064)
@@ -464,6 +464,14 @@
         self._response.setHeader("WWW-Authenticate", challenge, True)
         self._response.setStatus(401)
 
+    def setPrincipal(self, principal):
+        'See IPublicationRequest'
+        super(HTTPRequest, self).setPrincipal(principal)
+
+        logging_info = ILoggingInfo(principal)
+        message = logging_info.getLogMessage()
+        self.response.setHeader('x-zope-principal', message)
+
     def _createResponse(self, outstream):
         # Should be overridden by subclasses
         return HTTPResponse(outstream)



More information about the Zope3-Checkins mailing list