I've got a Folder (indirection) and a DTML Method (found) in the root of a Zope site. HEAD requests fail on the indirected DTML Method due to OFS.ObjectManager's __getitem__ method:

    def __getitem__(self, key):
        import pdb;pdb.set_trace()
        v=self._getOb(key, None)
        if v is not None: return v
        if hasattr(self, 'REQUEST'):
            method=request.get('REQUEST_METHOD', 'GET')
if request.maybe_webdav_client and not method in ('GET', 'POST'):
                return NullResource(self, key, request).__of__(self)
        raise KeyError, key

I wasn't around during the development of the WebDAV code, so I'm loathe to just jump in and start changing things, but why isn't 'HEAD' exempted from the NullResource as well, given that HTTP specs state that HEAD *must* return the same headers that a GET would provide (ignoring for the moment the Collector issue thread over whether HEAD should provide the length of the source of a document or its fully rendered content - let's just try to make sure both methods work on the *same object*). What was the reasoning behind the decision? These changes happened way back in the Dark Ages (late March 1999 or so, earlier in the month, this code was added to OFS.Folder with the initial WebDAV support). A trip through the WayBackMachine™ shows no discussion in the Zope-dev lists in early 1999 when this was being worked on, and no real mention of WebDAV in Zope for most of the rest of that year (on Zope-dev or the general Zope list). Am I mistaking this for a problem?

  [EMAIL PROTECTED] $ curl http://localhost:2277/found
  [EMAIL PROTECTED] $ curl http://localhost:2277/indirection/found
  [EMAIL PROTECTED] $ curl -I http://localhost:2277/found
  HTTP/1.1 200 OK
  Server: Apache
  Date: Wed, 28 Dec 2005 18:59:58 GMT
  Last-Modified: Wed, 28 Dec 2005 18:54:07 GMT
  Accept-Ranges: none
  Content-Type: text/html
  Content-Length: 5

  [EMAIL PROTECTED] $ curl -I http://localhost:2277/indirection/found
  HTTP/1.1 404 Not Found
  Server: Apache
  Date: Wed, 28 Dec 2005 19:00:10 GMT
  Bobo-Exception-Line: 63
  Content-Length: 891
  Bobo-Exception-Value: See the server error log for details
  Content-Type: text/html
  Accept-Ranges: none
  Bobo-Exception-File: NullResource.py
  Bobo-Exception-Type: NotFound



Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to