davuseragent ============ The Problem ----------- Zope 3 currently distinguishes different HTTP requests the following way: * If it's not GET, POST or HEAD, it's a regular HTTP/WebDAV request * If it's POST and the content type starts with 'text/xml', it must be XML-RPC * Otherwise, it's a browser request The problem with this approach is that WebDAV clients seeking to edit a particular object are treated like a browser client when they do a GET. That way, they get to see the fully rendered default view of an object instead of the filerepresentation source that they expect. Of course, clients are theoretically supposed to do a PROPFIND request for the source, but no known client does so. The Solution ------------ To solve this problem, Zope 2 invented a WebDAV source port, a different port to which one could connect WebDAV clients and where a GET request always led to the source of objects. This approach is impractical for a number of reasons: o Users invariably can't remember the port (and shouldn't have to) o Firewalls invariably block high ports (and firewall admins shouldn't have to know about DAV source port hacks) o When used behind Apache, security means SSL, and SSL+weird port numbers is yet-another-thing to manage. With `davuseragent`, we follow a different approach: We decide based on the User-Agent header of the incoming request whether we have a WebDAV client or not. That allows us to support a definite set of clients that are known to work together with Zope 3's DAV support (which is, admittedly, far from perfect). `davuseragent` is not trying to please everyone. It tries to make DAV workable for a limited set of well-known and widely-used clients. Of course, given the variance amongst DAV clients, trying to claim support for an arbitrary list has proven more than Zope can sign up for. How it works ------------ Upon an incoming HTTP request, Zope 3's HTTPServer delegates to a request/publication factory. The default one is located in `zope.app.publication` and currently decides which request type to instantiate based on the rule described in the first section of this document. `davuseragent` simply provides an alternate implementation of a request/publication factory. In consequence, it provides a new HTTP server type which works like the regular `HTTP` server type, but uses the alternate factory. Installation ------------ In order to enable `davuseragent`, you'll have to install it as a regular Zope 3 package in `package-includes` and change your `server` section in `zope.conf` to use the new server type, e.g.:: type DAVUserAgent address 8080 That's it! Philipp von Weitershausen, philikon@philikon.de Paul Everitt, paul@zope-europe.org