Issue 83838

Summary: Extension can not download update from web site with WebDAV
Product: extensions Reporter: Daniel Darabos <darabos.daniel>
Component: wwwAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, stx123
Version: current   
Target Milestone: milestone 1   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Description Flags
Patch to make webdav work on Mac OSX none

Description Daniel Darabos 2007-11-22 05:30:27 UTC
I have a Plone ( site that hosts updates to an extension. fails to download the extension update from the site while it can
be downloaded with any browser by loading the URL that is
complaining about.

The server access logs show that does not send a GET HTTP
request, but instead sends an OPTIONS request and a PROPFIND request after that.
I have replicated sending these requests, and the problem is most likely that
PROPFIND responds 401 Unauthorized.

Actually WebDAV is disabled in this instance of Plone and that is why I guess it
replies Unauthorized (and also because the computer with is not
authorized anyway).

I have looked around the code, and I guess
ucb/source/ucp/webdav/webdavcontent.cxx is at fault. In particular in the
getResourceType method it decides if a resource is an HTTP or a WebDAV resource
by looking at the response to the OPTIONS request. Maybe it could be made more
robust by not deciding on the resource type in advance, but first try to read
the resource as if it were a WebDAV resource and if that fails fall back to
reading it as an HTTP resource. (I'm not sure it can be done, I'm not very
familiar with WebDAV at all.)

Or the downloading code in UpdateInstallDialog::Thread::download() could
altogether be changed to not use this overly clever ucb resource mechanism but
instead simply download from the URL. I don't think looking for WebDAV resources
makes sense in the case of downloading the update. (Of course once again I have
very little idea about WebDAV, sorry if I'm completely wrong here.)

Of course if you have some advice on how to configure the server to avoid this
problem, that would be appreciated as well!

For now I will just comment out this piece of code in Zope (the application
server running Plone):

        # 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) 

Funny, eh? :) Both and Plone work well with other software that
does not support WebDAV, but they fail with each other, because they both have
flaky support for it...
Comment 1 Daniel Darabos 2007-11-22 12:33:46 UTC
In defense of Plone/Zope: It looks like they acted on the TODO, because
commenting out that line did nothing -- instead a similar line was found in a
more complicated file that indeed (I think) does interface checks.

If anyone else encounters this problem, the file is:
Comment 2 ldubost 2008-07-28 20:59:52 UTC
Created attachment 55412 [details]
Patch to make webdav work on Mac OSX
Comment 3 ldubost 2008-07-28 21:08:12 UTC
For those who want to try the patch on an Mac OSX install, here is a built version:

It replaces the one in

It works as a replacement to the one in OO 3.0b2 (BEB300m3 build 9328)
Comment 4 ldubost 2008-07-28 21:10:01 UTC
oops... forget my patch and last comment.. this was for bug 81536. If some admin
can delete them please do.