[Zope-dev] Zope 2 WebDAV and acquisition

Martin Aspeli optilude+lists at gmail.com
Mon Oct 5 22:44:12 EDT 2009


Shane Hathaway <shane <at> hathawaymix.org> writes:

> 
> Martin Aspeli wrote:
> >> Can anyone explain why that condition is there? Otherwise, I'll rip it 
> >> out. 
> 
> As I recall, this code is convoluted because it's hard to tell whether 
> an HTTP request is a WebDAV request.  If there is now a way to clearly 
> distinguish WebDAV requests, then I imagine this code can be greatly 
> simplified.  This code had to deal with Windows 95 and such.

Well, at the very least, you can use the check that says:

    if request.maybe_webdav_client and \
       request['HTTP_REQUEST_METHOD'] not in ('GET', 'POST')":

This wouldn't solve the problem for WebDAV GET or POST requests, but that's
actually fine. The problem seen here mainly pertain to PUT and PROPFIND requests.

This would meant that there's a chance people could get a weird acquisition
chain on a GET request that then wouldn't resolve properly (giving a 404) on a
subsequent PROPFIND or PUT, but this is very unlikely to happen in practice
unless someone (a) overrode listDAVObjects() to return acquired objects or (b)
manually entered a WebDAV URL that resulted in acquisition, and which was only
used for a GET.

Compared to the situation right now where PUT is broken for any file that has
the same name as an object higher up in the acquisition chain, not supporting
these arguably-invalid edge cases seems a lot better. :)

Martin



More information about the Zope-Dev mailing list