[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/http/options.py Added a note how a better algorithm could look like.

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Jul 9 11:45:25 EDT 2004


Log message for revision 26310:

Added a note how a better algorithm could look like.

Converted XXX to TODO.




-=-
Modified: Zope3/trunk/src/zope/app/http/options.py
===================================================================
--- Zope3/trunk/src/zope/app/http/options.py	2004-07-09 15:45:23 UTC (rev 26309)
+++ Zope3/trunk/src/zope/app/http/options.py	2004-07-09 15:45:25 UTC (rev 26310)
@@ -18,7 +18,7 @@
 _allowed_methods = ['PUT', 'DELETE', 'CONNECT', \
            'OPTIONS', 'PATCH', 'PROPFIND', 'PROPPATCH', 'MKCOL', \
            'COPY', 'MOVE', 'LOCK', 'UNLOCK', 'TRACE']
-           # XXX 'GET', 'HEAD', 'POST' are always available?
+           # 'GET', 'HEAD', 'POST' are always available. See OPTIONS() method.
 
 from zope.component import queryView
 
@@ -32,16 +32,19 @@
 
     def OPTIONS(self):
         allowed = ['GET', 'HEAD', 'POST']
+        # TODO: This could be cleaned up by providing special target
+        # interfaces for HTTP methods. This way we can even list verbs that
+        # are not in the lists above.
         for m in _allowed_methods:
             view = queryView(self.context, m, self.request, None)
             if view is not None:
                 allowed.append(m)
 
         self.request.response.setHeader('Allow', ', '.join(allowed))
-        # XXX Most of the time, this is a lie. We not fully support
+        # TODO: Most of the time, this is a lie. We not fully support
         # DAV 2 on all objects, so probably an interface check is needed.
         self.request.response.setHeader('DAV', '1,2', literal=True)
-        # XXX UGLY! Some clients rely on this. eg: MacOS X
+        # UGLY! Some clients rely on this. eg: MacOS X
         self.request.response.setHeader('MS-Author-Via', 'DAV', literal=True)
         self.request.response.setStatus(200)
         return ''



More information about the Zope3-Checkins mailing list