[Zope-Coders] Re: [Zope] WebDAV Locks / 2.4.3/ MS Office 2000

Tres Seaver tseaver@zope.com
Wed, 16 Jan 2002 07:16:48 -0500


Andreas Jung wrote:

> ----- Original Message -----
> From: "Chris Withers" <chrisw@nipltd.com>
> To: "Joachim Werner" <joe@iuveno-net.de>
> Cc: "Jason Earl" <jason.earl@simplot.com>; <zope-coders@zope.org>;
> <andreas@zope.com>
> Sent: Wednesday, January 16, 2002 07:05
> Subject: [Zope-Coders] Re: [Zope] WebDAV Locks / 2.4.3/ MS Office 2000
> 
> 
>>Basically, if either the 'MS-Author-Via' or 'DAV' headers are set in the
>>request, Excel _will_ try and lock the file using a WebDAV LOCK command,
>>regardless of whether the user only wants to (or has) read access, or what
>>the OPTIONS response tells it the server _can_ do...
>>
>>Worse still, thanks to Zope's implementation, only one Anonymous user may
>>have a LOCK on an object at a time.
>>
>>So, how do we go about modifying Zope so that it only sets those two
>>headers when the user has write access to the object AND the User-Agent
>>is either "Microsoft Data Access Internet Publishing Provider Cache
>>Manager" or "Microsoft Data Access Internet Publishing Provider DAV"?
>>
> 
> What about a switch to disable WebDAV on the HTTP source port ?
> Zope must reply in this case with an "unsupported method" message
> when trying to call LOCK, OPTIONS etc.


I think I misread here -- turning off WebDAV on the "source port" defeats
the purpose of said port altogether, which is to support WebDAV (it is
actually called the "WebDAV source port".  Perhaps you meant to turn it
off on the "main" HTTP port?


>>PS: On a more thorny note, if I wanna get these changes into the Zope
>>core, I'll need tests. How on earth do I go about writing tests for this?
>>
> 
> That is hard. Depending on the complexity of the
> hack/fix/what-ever-you-call-it some extended
> tests might be sufficient. E.g. there is no unittest for the
> Office2k/WebDAV/Locking problem
> fixed in 2.4.4.


You are also going to need to defend the changes, as they are

potentially destabilizing for clients which do WebDAV correctly
(at least if I understand to tag-end of the discussion I have
seen so far).  A unit tests for a feature which depends on a
REQUEST header just needs to synthesize an appropriate request
(i.e., it needs to pretend to be the publisher), no?


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com