[CalendarServer-changes] [3009] CalendarServer/trunk/twistedcaldav/resource.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 17 10:37:46 PDT 2008


Revision: 3009
          http://trac.macosforge.org/projects/calendarserver/changeset/3009
Author:   wsanchez at apple.com
Date:     2008-09-17 10:37:45 -0700 (Wed, 17 Sep 2008)
Log Message:
-----------
Revert most of r2999, which isn't necessary.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2008-09-17 15:31:19 UTC (rev 3008)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2008-09-17 17:37:45 UTC (rev 3009)
@@ -159,17 +159,12 @@
             agent = request.headers.getHeader("user-agent")
             if agent is not None:
                 for reject in config.RejectClients:
-                    try:
-                        result = reject.search(agent)
-                    except TypeError:
-                        raise AssertionError("User-agent is not a string: (%s) %r", type(agent), agent)
-                    else:
-                        if result 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,)
-                            ))
+                    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)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080917/fc3be037/attachment.html 


More information about the calendarserver-changes mailing list