[CalendarServer-changes] [3041] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 24 09:45:23 PDT 2008


Revision: 3041
          http://trac.macosforge.org/projects/calendarserver/changeset/3041
Author:   wsanchez at apple.com
Date:     2008-09-24 09:45:23 -0700 (Wed, 24 Sep 2008)
Log Message:
-----------
Pull up RejectClients fix in r3040

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/resource.py
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/root.py

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/resource.py	2008-09-24 16:43:06 UTC (rev 3040)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/resource.py	2008-09-24 16:45:23 UTC (rev 3041)
@@ -147,19 +147,6 @@
         return super(CalDAVResource, self).render(request)
 
     def renderHTTP(self, request):
-        if config.RejectClients:
-            #
-            # Filter out unsupported clients
-            #
-            agent = request.headers.getHeader("user-agent")
-            for reject in config.RejectClients:
-                if reject.search(agent) is not None:
-                    self.log_info("Rejecting user-agent: %s" % (agent,))
-                    raise HTTPError(StatusResponse(
-                        responsecode.FORBIDDEN,
-                        "Your client software (%s) is not allowed to access this service." % (agent,)
-                    ))
-
         response = maybeDeferred(super(CalDAVResource, self).renderHTTP, request)
 
         def setHeaders(response):

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/root.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/root.py	2008-09-24 16:43:06 UTC (rev 3040)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/root.py	2008-09-24 16:45:23 UTC (rev 3041)
@@ -25,7 +25,7 @@
 
 from twisted.web2 import responsecode
 from twisted.web2.dav import davxml
-from twisted.web2.http import HTTPError
+from twisted.web2.http import HTTPError, StatusResponse
 from twisted.web2.auth.wrapper import UnauthorizedResponse
 
 from twistedcaldav.extensions import DAVFile, CachingXattrPropertyStore
@@ -176,6 +176,20 @@
 
             return d
 
+        if config.RejectClients:
+            #
+            # Filter out unsupported clients
+            #
+            agent = request.headers.getHeader("user-agent")
+            if agent is not None:
+                for reject in config.RejectClients:
+                    if reject.search(agent) is not None:
+                        log.info("Rejecting user-agent: %s" % (agent,))
+                        raise HTTPError(StatusResponse(
+                            responsecode.FORBIDDEN,
+                            "Your client software (%s) is not allowed to access this service." % (agent,)
+                        ))
+
         def _getCachedResource(_ign, request):
             if not getattr(request, 'checkingCache', False):
                 request.checkingCache = True
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080924/906d01d3/attachment.html 


More information about the calendarserver-changes mailing list