view Side-By-Side changes
WebDAV L. Dusseault Internet-Draft OSAF Expires: January15, 200516, 2006 J. Crawford IBM July17, 200415, 2005 HTTP Extensions for Distributed Authoring - WebDAV RFC2518 bisdraft-ietf-webdav-rfc2518bis-06draft-ietf-webdav-rfc2518bis-07 Status of this MemoThis documentBy submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she isan Internet-Draftaware have been or will be disclosed, andisany of which he or she becomes aware will be disclosed, infull conformanceaccordance withall provisions ofSection106 ofRFC2026.BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents asInternet-Drafts.Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed athttp:// www.ietf.org/ietf/1id-abstracts.txt.http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on January15, 2005.16, 2006. Copyright Notice Copyright (C) The Internet Society(2004). All Rights Reserved.(2005). Abstract WebDAV consists of a set of methods, headers, and content-types ancillary to HTTP/1.1 for the management of resource properties, creation and management of resource collections, namespace manipulation, and resource locking (collision avoidance). RFC2518 was published in February 1998, and this draft makes minor revisions mostly due to interoperability experience. Dusseault & Crawford Expires January15, 200516, 2006 [Page 1] Internet-Draft RFC2518bis July20042005 Table of Contents 1. IntroductionThis document describes an extension to the HTTP/1.1 protocol that allows clients to perform remote web content authoring operations. This extension provides a coherent set of methods, headers, request entity body formats, and response entity body formats that provide operations for: Properties: The ability to create, remove, and query information about Web pages, such as their authors, creation dates, etc. Also, the ability to link pages of any media type to related pages. Collections:. . . . . . . . . . . . . . . . . . . . . . . . 7 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 9 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . 10 4. Data Model for Resource Properties . . . . . . . . . . . . . 11 4.1 Theability to create sets of documentsResource Property Model . . . . . . . . . . . . . . 11 4.2 Properties andto retrieve a hierarchical membership listing (like a directory listing in a file system). Locking: The ability to keep more than one person from working on a document at the same time. This prevents the "lost update problem", in which modifications are lost as first one author then another writes changes without merging the other author's changes. Namespace Operations: The ability to instruct the server to copyHTTP Headers . . . . . . . . . . . . . . 11 4.3 XML Usage . . . . . . . . . . . . . . . . . . . . . . . 11 4.4 Property Values . . . . . . . . . . . . . . . . . . . . 12 4.5 Property Names . . . . . . . . . . . . . . . . . . . . . 13 4.6 Source Resources andmoveOutput Resources . . . . . . . . . 14 5. Collections of Webresources. Requirements and rationale for these operations are described in a companion document, "Requirements for a Distributed AuthoringResources . . . . . . . . . . . . . . . . 15 5.1 HTTP URL Namespace Model . . . . . . . . . . . . . . . . 15 5.2 Collection Resources . . . . . . . . . . . . . . . . . . 15 6. Locking . . . . . . . . . . . . . . . . . . . . . . . . . . 17 6.1 Exclusive Vs. Shared Locks . . . . . . . . . . . . . . . 17 6.2 Required Support . . . . . . . . . . . . . . . . . . . . 18 6.3 Lock Tokens . . . . . . . . . . . . . . . . . . . . . . 18 6.4 Lock Token URI Schemes . . . . . . . . . . . . . . . . . 19 6.5 Lock Capability Discovery . . . . . . . . . . . . . . . 19 6.6 Active Lock Discovery . . . . . . . . . . . . . . . . . 20 6.7 Locks andVersioning Protocol for the World Wide Web" (RFC2291) [15]. This standard does not specify the versioning operations suggestedMultiple Bindings . . . . . . . . . . . . . . 20 7. Write Lock . . . . . . . . . . . . . . . . . . . . . . . . . 21 7.1 Lock Owner . . . . . . . . . . . . . . . . . . . . . . . 21 7.2 Methods Restricted byRFC2291 [15]. That work was done in a separate document, "Versioning Extensions to WebDAV" (RFC3253) [18]. The sections below provide a detailed introduction to resource properties (Section 4), collections of resources (Section 5),Write Locks . . . . . . . . . . . 21 7.3 Write Locks andlocking operations (Section 6). These sections introduce the abstractions manipulated by the WebDAV-specific HTTP methods (Section 8)Lock Tokens . . . . . . . . . . . . . . 22 7.4 Write Locks and Properties . . . . . . . . . . . . . . . 22 7.5 Avoiding Lost Updates . . . . . . . . . . . . . . . . . 22 7.6 Write Locks and Unmapped URLs . . . . . . . . . . . . . 23 7.7 Write Locks and Collections . . . . . . . . . . . . . . 25 7.8 Write Locks and thenewIf Request Header . . . . . . . . . 26 7.9 Write Locks and COPY/MOVE . . . . . . . . . . . . . . . 27 7.10 Refreshing Write Locks . . . . . . . . . . . . . . . . . 28 8. HTTPheaders used with WebDAV methods (Section 9). While the status codes provided by HTTP/1.1 are sufficient to describe most error conditions encountered by WebDAV methods, there are some errors that do not fall neatly into the existing categories. This specification defines new status codes developedMethods forWebDAV methods (Section 10)Distributed Authoring . . . . . . . . . . . 29 8.1 General request anddescribes existing HTTP status codes (Section 11) as used in WebDAV. Since some WebDAV methods may operate over many resources, the Multi-Statusresponse(Section 12) has been introduced to return status information for multiple resources. Finally, this versionhandling . . . . . . . . . 29 8.1.1 Use ofWebDAV introducesXMLelements. . . . . . . . . . . . . . . . . . . . . 29 8.1.2 Required Bodies in Requests . . . . . . . . . . . . 29 8.1.3 Use of Location header in responses . . . . . . . . 29 8.1.4 Required Response Headers: Date . . . . . . . . . . 29 8.1.5 ETag . . . . . . . . . . . . . . . . . . . . . . . . 29 8.1.6 Including error response bodiesin Section 15.. . . . . . . . . . 30 8.2 PROPFIND . . . . . . . . . . . . . . . . . . . . . . . . 31 8.2.1 Example - Retrieving Named Properties . . . . . . . 33 8.2.2 Example - Retrieving Named and Dead Properties . . . 35 8.2.3 Example - Using propname to Retrieve all Property Names . . . . . . . . . . . . . . . . . . . . . . . 35 8.2.4 PROPFIND Request Errors . . . . . . . . . . . . . . 37 Dusseault & Crawford Expires January15, 200516, 2006 [Page 2] Internet-Draft RFC2518bis July2004 WebDAV uses XML [11] to marshal complicated request2005 8.3 PROPPATCH . . . . . . . . . . . . . . . . . . . . . . . 37 8.3.1 Status Codes for use with 207 (Multi-Status) . . . . 37 8.3.2 Example - PROPPATCH . . . . . . . . . . . . . . . . 39 8.4 MKCOL Method . . . . . . . . . . . . . . . . . . . . . . 40 8.4.1 MKCOL Status Codes . . . . . . . . . . . . . . . . . 40 8.4.2 Example - MKCOL . . . . . . . . . . . . . . . . . . 41 8.5 GET, HEAD for Collections . . . . . . . . . . . . . . . 41 8.6 POST for Collections . . . . . . . . . . . . . . . . . . 42 8.7 DELETE . . . . . . . . . . . . . . . . . . . . . . . . . 42 8.7.1 DELETE for Non-Collection Resources . . . . . . . . 42 8.7.2 DELETE for Collections . . . . . . . . . . . . . . . 42 8.7.3 Example - DELETE . . . . . . . . . . . . . . . . . . 43 8.8 PUT . . . . . . . . . . . . . . . . . . . . . . . . . . 43 8.8.1 PUT for Non-Collection Resources . . . . . . . . . . 43 8.8.2 PUT for Collections . . . . . . . . . . . . . . . . 44 8.9 COPY . . . . . . . . . . . . . . . . . . . . . . . . . . 44 8.9.1 COPY for Non-collection Resources . . . . . . . . . 44 8.9.2 COPY for Properties . . . . . . . . . . . . . . . . 45 8.9.3 COPY for Collections . . . . . . . . . . . . . . . . 45 8.9.4 COPY andresponse information, as well as to express metadata, so this specification contains definitions of all XML elements used (Section 13). WebDAV includes a few special rules on how to process XML (Section 16) appearing in WebDAV so that it truly is extensible. WebDAV employs the property mechanism to store information about the current state of the resource. For example, when a lock is taken out on a resource, a lock information property describes the current state ofthelock. Finishing offOverwrite Header . . . . . . . . . . . 46 8.9.5 Status Codes . . . . . . . . . . . . . . . . . . . . 47 8.9.6 COPY Examples . . . . . . . . . . . . . . . . . . . 47 8.10 MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . 49 8.10.1 MOVE for Properties . . . . . . . . . . . . . . . . 50 8.10.2 MOVE for Collections . . . . . . . . . . . . . . . . 50 8.10.3 MOVE and thespecification are sections on what it means to be compliant with this specification (Section 17), on internationalization support (Section 18),Overwrite Header . . . . . . . . . . . 51 8.10.4 Status Codes . . . . . . . . . . . . . . . . . . . . 51 8.10.5 Examples . . . . . . . . . . . . . . . . . . . . . . 52 8.11 LOCK Method . . . . . . . . . . . . . . . . . . . . . . 53 8.11.1 Refreshing Locks . . . . . . . . . . . . . . . . . . 54 8.11.2 Depth andon security (Section 19).Locking . . . . . . . . . . . . . . . . . 55 8.11.3 Locking Unmapped URLs . . . . . . . . . . . . . . . 55 8.11.4 Lock Compatibility Table . . . . . . . . . . . . . . 56 8.11.5 LOCK responses . . . . . . . . . . . . . . . . . . . 56 8.11.6 Example - Simple Lock Request . . . . . . . . . . . 57 8.11.7 Example - Refreshing a Write Lock . . . . . . . . . 59 8.11.8 Example - Multi-Resource Lock Request . . . . . . . 60 8.12 UNLOCK Method . . . . . . . . . . . . . . . . . . . . . 61 8.12.1 Status Codes . . . . . . . . . . . . . . . . . . . . 61 8.12.2 Example . . . . . . . . . . . . . . . . . . . . . . 62 9. HTTP Headers for Distributed Authoring . . . . . . . . . . . 63 9.1 DAV Header . . . . . . . . . . . . . . . . . . . . . . . 63 9.2 Depth Header . . . . . . . . . . . . . . . . . . . . . . 63 9.3 Destination Header . . . . . . . . . . . . . . . . . . . 65 9.4 Force-Authentication Header . . . . . . . . . . . . . . 65 9.5 If Header . . . . . . . . . . . . . . . . . . . . . . . 65 9.5.1 No-tag-list Production . . . . . . . . . . . . . . . 66 9.5.2 Tagged-list Production . . . . . . . . . . . . . . . 67 Dusseault & Crawford Expires January15, 200516, 2006 [Page 3] Internet-Draft RFC2518bis July2004 2. Notational Conventions Since this document describes a set of extensions2005 9.5.3 Not Production . . . . . . . . . . . . . . . . . . . 67 9.5.4 Matching Function . . . . . . . . . . . . . . . . . 68 9.5.5 If Header and Non-DAV Aware Proxies . . . . . . . . 69 9.6 Lock-Token Header . . . . . . . . . . . . . . . . . . . 69 9.7 Overwrite Header . . . . . . . . . . . . . . . . . . . . 69 9.8 Timeout Request Header . . . . . . . . . . . . . . . . . 69 10. Status Code Extensions totheHTTP/1.1protocol, the augmented BNF used herein to describe protocol elements is exactly the same as described in section 2.1. . . . . . . . . . . . 71 10.1 102 Processing . . . . . . . . . . . . . . . . . . . . . 71 10.2 207 Multi-Status . . . . . . . . . . . . . . . . . . . . 71 10.3 422 Unprocessable Entity . . . . . . . . . . . . . . . . 71 10.4 423 Locked . . . . . . . . . . . . . . . . . . . . . . . 71 10.5 424 Failed Dependency . . . . . . . . . . . . . . . . . 72 10.6 507 Insufficient Storage . . . . . . . . . . . . . . . . 72 11. Use ofRFC2616 [8], including the rules about implied linear white-space. Since this augmented BNF uses the basic production rules providedHTTP Status Codes . . . . . . . . . . . . . . . . . 73 11.1 301 Moved Permanently . . . . . . . . . . . . . . . . . 73 11.2 302 Found . . . . . . . . . . . . . . . . . . . . . . . 73 11.3 400 Bad Request . . . . . . . . . . . . . . . . . . . . 73 11.4 403 Forbidden . . . . . . . . . . . . . . . . . . . . . 73 11.5 409 Conflict . . . . . . . . . . . . . . . . . . . . . . 73 11.6 412 Precondition Failed . . . . . . . . . . . . . . . . 73 11.7 414 Request-URI Too Long . . . . . . . . . . . . . . . . 74 11.8 503 Service Unavailable . . . . . . . . . . . . . . . . 74 12. Multi-Status Response . . . . . . . . . . . . . . . . . . 75 12.1 Responses requiring Location insection 2.2 of RFC2616 [8], these rules apply to this document as well. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC2119 [3].Multi-Status . . . . . . 75 13. XML Element Definitions . . . . . . . . . . . . . . . . . 77 13.1 activelock XML Element . . . . . . . . . . . . . . . . . 77 13.2 depth XML Element . . . . . . . . . . . . . . . . . . . 77 13.3 locktoken XML Element . . . . . . . . . . . . . . . . . 77 13.4 lockroot XML Element . . . . . . . . . . . . . . . . . . 78 13.5 timeout XML Element . . . . . . . . . . . . . . . . . . 78 13.6 collection XML Element . . . . . . . . . . . . . . . . . 79 13.7 href XML Element . . . . . . . . . . . . . . . . . . . . 79 13.8 lockentry XML Element . . . . . . . . . . . . . . . . . 79 13.9 lockinfo XML Element . . . . . . . . . . . . . . . . . . 80 13.10 lockscope XML Element . . . . . . . . . . . . . . . . 80 13.11 exclusive XML Element . . . . . . . . . . . . . . . . 80 13.12 shared XML Element . . . . . . . . . . . . . . . . . . 81 13.13 locktype XML Element . . . . . . . . . . . . . . . . . 81 13.14 write XML Element . . . . . . . . . . . . . . . . . . 82 13.15 multistatus XML Element . . . . . . . . . . . . . . . 82 13.16 response XML Element . . . . . . . . . . . . . . . . . 82 13.17 propstat XML Element . . . . . . . . . . . . . . . . . 83 13.18 status XML Element . . . . . . . . . . . . . . . . . . 83 13.19 responsedescription XML Element . . . . . . . . . . . 84 13.20 owner XML Element . . . . . . . . . . . . . . . . . . 84 13.21 prop XML element . . . . . . . . . . . . . . . . . . . 85 13.22 propertyupdate XML element . . . . . . . . . . . . . . 85 13.23 remove XML element . . . . . . . . . . . . . . . . . . 85 Dusseault & Crawford Expires January15, 200516, 2006 [Page 4] Internet-Draft RFC2518bis July2004 3. Terminology URI/URL - A Uniform Resource Identifier and Uniform Resource Locator, respectively. These terms (and the distinction between them) are defined in RFC2396 [6]. Collection - A resource that contains a2005 13.24 setof URLs, which identify and locate member resources and which meetXML element . . . . . . . . . . . . . . . . . . . 86 13.25 propfind XML Element . . . . . . . . . . . . . . . . . 86 13.26 allprop XML Element . . . . . . . . . . . . . . . . . 87 13.27 propname XML Element . . . . . . . . . . . . . . . . . 87 13.28 dead-props XML Element . . . . . . . . . . . . . . . . 87 13.29 location XML Element . . . . . . . . . . . . . . . . . 88 13.30 error XML Element . . . . . . . . . . . . . . . . . . 88 14. DAV Properties . . . . . . . . . . . . . . . . . . . . . . 89 14.1 creationdate Property . . . . . . . . . . . . . . . . . 89 14.2 displayname Property . . . . . . . . . . . . . . . . . . 90 14.3 getcontentlanguage Property . . . . . . . . . . . . . . 90 14.4 getcontentlength Property . . . . . . . . . . . . . . . 91 14.5 getcontenttype Property . . . . . . . . . . . . . . . . 91 14.6 getetag Property . . . . . . . . . . . . . . . . . . . . 92 14.7 getlastmodified Property . . . . . . . . . . . . . . . . 93 14.8 lockdiscovery Property . . . . . . . . . . . . . . . . . 94 14.8.1 Example - Retrieving thecollections requirements (Section 5). Member URLlockdiscovery Property . . 94 14.9 resourcetype Property . . . . . . . . . . . . . . . . . 96 14.10 supportedlock Property . . . . . . . . . . . . . . . . 96 14.10.1 Example -A URL which is a member ofRetrieving theset of URLs contained by a collection. Internal Member URL - A Member URL that is immediately relative to the URLsupportedlock Property . 98 15. Precondition/postcondition XML elements . . . . . . . . . 99 16. Instructions for Processing XML in DAV . . . . . . . . . . 102 17. DAV Compliance Classes . . . . . . . . . . . . . . . . . . 103 17.1 Class 1 . . . . . . . . . . . . . . . . . . . . . . . . 103 17.2 Class 2 . . . . . . . . . . . . . . . . . . . . . . . . 103 17.3 Class 'bis' . . . . . . . . . . . . . . . . . . . . . . 103 18. Internationalization Considerations . . . . . . . . . . . 105 19. Security Considerations . . . . . . . . . . . . . . . . . 107 19.1 Authentication ofthe collection (the definitionClients . . . . . . . . . . . . . . . 107 19.2 Denial ofimmediately relative is given later (Section 5.2)). PropertyService . . . . . . . . . . . . . . . . . . . 107 19.3 Security through Obscurity . . . . . . . . . . . . . . . 108 19.4 Privacy Issues Connected to Locks . . . . . . . . . . . 108 19.5 Privacy Issues Connected to Properties . . . . . . . . . 108 19.6 Implications of XML External Entities . . . . . . . . . 109 19.7 Risks Connected with Lock Tokens . . . . . . . . . . . . 109 20. IANA Considerations . . . . . . . . . . . . . . . . . . . 111 21. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 112 22. References . . . . . . . . . . . . . . . . . . . . . . . . 113 22.1 Normative References . . . . . . . . . . . . . . . . . . 113 22.2 Informational References . . . . . . . . . . . . . . . . 113 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 114 A. Previous Authors' Addresses . . . . . . . . . . . . . . . . 115 B. Appendices . . . . . . . . . . . . . . . . . . . . . . . . . 116 B.1 Appendix 1 -A name/value pair that contains descriptive information about a resource. Live PropertyNotes on Processing XML Elements . . . . . 116 B.1.1 Notes on Empty XML Elements . . . . . . . . . . . . 116 B.1.2 Notes on Illegal XML Processing . . . . . . . . . . 116 B.1.3 Example -A property whose semantics and syntax are enforced by the server. For example, the live "getcontentlength" property has its value, the length of the entity returned by a GET request, automatically calculated by the server. Dead PropertyXML Syntax Error . . . . . . . . . . . . . 116 B.1.4 Example -A property whose semantics and syntax are not enforced by the server. The server only records the value of a dead property; the client is responsible for maintaining the consistency of the syntax and semantics of a dead property.Unknown XML Element . . . . . . . . . . . 117 Dusseault & Crawford Expires January15, 200516, 2006 [Page 5] Internet-Draft RFC2518bis July2004 4. Data Model for Resource Properties 4.1 The Resource Property Model Properties are pieces of data that describe the state of a resource. Properties are data about data. Properties are used2005 B.2 Appendix 3: Notes on HTTP Client Compatibility . . . . . 118 B.3 Changes . . . . . . . . . . . . . . . . . . . . . . . . 119 B.3.1 Changes indistributed authoring environments to provide for efficient discovery-06 . . . . . . . . . . . . . . . . . . . 119 B.3.2 Changes in -07 . . . . . . . . . . . . . . . . . . . 119 Intellectual Property andmanagement of resources. For example, a 'subject' property might allow forCopyright Statements . . . . . . . 121 Dusseault & Crawford Expires January 16, 2006 [Page 6] Internet-Draft RFC2518bis July 2005 1. Introduction This document describes an extension to theindexingHTTP/1.1 protocol that allows clients to perform remote web content authoring operations. This extension provides a coherent set ofall resources by their subject,methods, headers, request entity body formats, andan 'author' property might allow forresponse entity body formats that provide operations for: Properties: The ability to create, remove, and query information about Web pages, such as their authors, creation dates, etc. Also, thediscoveryability to link pages ofwhat authors have written which documents.any media type to related pages. Collections: TheDAV property model consistsability to create sets ofname/value pairs.documents and to retrieve a hierarchical membership listing (like a directory listing in a file system). Locking: Thename ofability to keep more than one person from working on aproperty identifiesdocument at theproperty's syntax and semantics, and provides an address bysame time. This prevents the "lost update problem", in which modifications are lost as first one author then another writes changes without merging the other author's changes. Namespace Operations: The ability toreferinstruct the server toits syntaxcopy andsemantics. There are two categories of properties: "live"move Web resources. Requirements and"dead". A live property has its syntaxrationale for these operations are described in a companion document, "Requirements for a Distributed Authoring andsemantics enforced byVersioning Protocol for theserver. Live properties include cases where a)World Wide Web" (RFC2291) [12]. This standard does not specify thevalue of a property is read- only, maintainedversioning operations suggested bythe server, and b) the valueRFC2291 [12]. That work was done in a separate document, "Versioning Extensions to WebDAV" (RFC3253) [14]. The sections below provide a detailed introduction to resource properties (Section 4), collections of resources (Section 5), and locking operations (Section 6). These sections introduce theproperty is maintainedabstractions manipulated by theclient, butWebDAV-specific HTTP methods (Section 8) and theserver performs syntax checking on submitted values. All instances of a given live property MUST complynew HTTP headers used with WebDAV methods (Section 9). While thedefinition associated with that property name. A dead property has its syntax and semantics enforcedstatus codes provided by HTTP/1.1 are sufficient to describe most error conditions encountered by WebDAV methods, there are some errors that do not fall neatly into theclient; the server merely records the value of the property verbatim. 4.2 Existing Metadata Proposals Properties have long played an essential role in the maintenance of large document repositories,existing categories. This specification defines new status codes developed for WebDAV methods (Section 10) andmany current proposals containdescribes existing HTTP status codes (Section 11) as used in WebDAV. Since somenotionWebDAV methods may operate over many resources, the Multi-Status response (Section 12) has been introduced to return status information for multiple resources. Finally, this version ofa property, or discuss web metadata more generally. These include PICS [20], PICS-NG, XML, Web Collections, and several proposals on representing relationships within HTML. Work on PICS-NGWebDAV introduces XML elements Dusseault & Crawford Expires January 16, 2006 [Page 7] Internet-Draft RFC2518bis July 2005 in error response bodies in Section 15. WebDAV uses XML [11] to marshal complicated request andWeb Collections has been subsumed by the Resource Description Framework (RDF) metadata activity of the World Wide Web Consortium. RDF consistsresponse information, as well as to express metadata, so this specification contains definitions of all XML elements used (Section 13). WebDAV includes anetwork-based data model and anfew special rules on how to process XMLrepresentation of(Section 16) appearing in WebDAV so thatmodel. Some proposals come from a digital library perspective. These include the Dublin Core [RFC2413] metadata set andit truly is extensible. Finishing off theWarwick Framework [WF], a container architecturespecification are sections on what it means fordifferent metadata schemas. The literature includes many examples of metadata, including MARC [USMARC],abibliographic metadata format,resource to be compliant with this specification (Section 17), on internationalization support (Section 18), anda technical report bibliographic format employed by the Dienst system [RFC1807]. Additionally, the proceedings from the first IEEE Metadata conference describe many community-specific metadata sets.on security (Section 19). Dusseault & Crawford Expires January15, 200516, 2006 [Page6]8] Internet-Draft RFC2518bis July2004 Participants2005 2. Notational Conventions Since this document describes a set of extensions to the1996 Metadata II Workshop in Warwick, UK [WF], noted that "new metadata sets will develop asHTTP/1.1 protocol, thenetworked infrastructure matures" and "different communities will propose, design, and be responsible for different types of metadata." These observations can be corroborated by noting that many community- specific sets of metadata already exist, and thereaugmented BNF used herein to describe protocol elements issignificant motivation forexactly thedevelopment of new forms of metadatasame asmany communities increasingly make their data available in digital form, requiring a metadata format to assist data location and cataloging. 4.3 Properties and HTTP Headers Properties already exist, in a limited sense,described inHTTP message headers. However, in distributed authoring environments a relatively large numbersection 2.1 ofproperties are needed to describeRFC2616 [7], including thestaterules about implied linear white-space. Since this augmented BNF uses the basic production rules provided in section 2.2 ofa resource,RFC2616 [7], these rules apply to this document as well. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", andsetting/returning them all through HTTP headers is inefficient. Thus a mechanism is needed which allows a principal"OPTIONAL" in this document are toidentifybe interpreted as described in RFC2119 [2]. Dusseault & Crawford Expires January 16, 2006 [Page 9] Internet-Draft RFC2518bis July 2005 3. Terminology URI/URL - A Uniform Resource Identifier and Uniform Resource Locator, respectively. These terms (and the distinction between them) are defined in RFC2396 [5]. Collection - A resource that contains a set ofproperties inURLs, which identify and locate member resources and which meet theprincipalcollections requirements (Section 5). Member URL - A URL which isinterested and to set or retrieve just those properties. 4.4 XML Usage In HTTP/1.1, method parameter information was exclusively encoded in HTTP headers. Unlike HTTP/1.1, WebDAV encodes method parameter information either in an XML [11] request entity body, or in an HTTP header. The usea member ofXML to encode method parameters was motivated bytheability to add extra XML elements to existing structures, providing extensibility; andset of URLs contained byXML's abilitya collection. Internal Member URL - A Member URL that is immediately relative toencode information in ISO 10646 character sets, providing internationalization support. In addition to encoding method parameters, XML is used in WebDAV to encodetheresponses from methods, providingURL of theextensibility and internationalization advantagescollection (the definition ofXML for method output, as well as input. The XML namespace extension [10]immediately relative isalso used in this specification in order to allow for new XML elements to be added without fear of colliding with other element names. Although WebDAV requestgiven later (Section 5.2)). Property - A name/value pair that contains descriptive information about a resource. Live Property - A property whose semantics andresponse bodies can be extended by arbitrary XML elements, which can be ignoredsyntax are enforced by themessage recipient, an XML element inserver. For example, the"DAV:" namespace SHOULD NOT be used inlive "getcontentlength" property has its value, therequest or response body unless that XML element is explicitly defined in an IETF RFC reviewedlength of the entity returned by aWebDAV working group. Note that "DAV:" is a scheme name defined solely to provideGET request, automatically calculated by the server. Dead Property - A property whose semantics and syntax are not enforced by the server. The server only records the value of anamespacedead property; the client is responsible forWebDAV XML elementsmaintaining the consistency of the syntax andproperty names. This practice is discouraged in part because registrationsemantics ofnew scheme namesa dead property. Principal - A "principal" isdifficult. "DAV:" was defined as the WebDAV namespace beforea distinct human or computational actor that initiates access to network resources. Dusseault & Crawford Expires January15, 200516, 2006 [Page7]10] Internet-Draft RFC2518bis July2004 standard best practices emerged, and this namespace is kept and still used because of significant existing deployments, but this should not be emulated. 4.5 Property Values2005 4. Data Model for Resource Properties 4.1 ThevalueResource Property Model Properties are pieces ofa property is always a (well-formed) XML fragment. XML has been chosen because it is a flexible, self-describing, structureddataformatthatsupports rich schema definitions, and because of its support for multiple character sets. XML's self- describing nature allows any property's value to be extended by adding new elements. Older clients will not break when they encounter extensions because they will still havedescribe the state of a resource. Properties are dataspecifiedabout data. Properties are used inthe original schema and will ignore elements they do not understand. XML's support for multiple character sets allows any human-readable propertydistributed authoring environments tobe encodedprovide for efficient discovery andread inmanagement of resources. For example, acharacter set familiar to the user. XML's support'subject' property might allow formultiple human languages, using the "xml:lang" attribute, handles cases wherethesame character set is employedindexing of all resources bymultiple human languages. Note that xml:lang scope is recursive, so a xml:lang attribute on any element containing atheir subject, and an 'author' propertyname element applies tomight allow for the discovery of what authors have written which documents. The DAV propertyvalue unless it has been overridden bymodel consists of name/value pairs. The name of amore locally scoped attribute. Apropertyis always represented in XML with an XML element consisting ofidentifies theproperty name. The simplest example is an empty property,property's syntax and semantics, and provides an address by whichis different from a property that does not exist. <R:title xmlns:R="http://www.example.com/ns/"></R:title> The valueto refer to its syntax and semantics. There are two categories ofa property appears inside theproperties: "live" and "dead". A live propertyname element. The value may be any kind of well-formed XML content, including both text-onlyhas its syntax andmixed content. Whensemantics enforced by the server. Live properties include cases where a) thepropertyvaluecontains further XML elements, namespaces that are in scope for that partofthe XML document apply within thea propertyvalue as well,is read- only, maintained by the server, andMUST be preserved in server storage for retransmission later. Namespace prefixes need not be preserved due tob) therulesvalue ofprefix declaration in XML. Attributes onthe propertyname element may convey information aboutis maintained by theproperty,client, butare not considered part of the value. However, when language information appears inthe'xml:lang' attributeserver performs syntax checking onthesubmitted values. All instances of a given live propertyname element, the language information MUST be preserved in server storage for retransmission later. The XML attribute xml:spaceMUSTNOT be used to change white space handling. White space in property values is significant. Dusseault & Crawford Expires January 15, 2005 [Page 8] Internet-Draft RFC2518bis July 2004 4.6 Property Names A property name is a universally unique identifier that iscomply with the definition associated witha schemathatprovides information about theproperty name. A dead property has its syntax and semanticsofenforced by theproperty. Because a property's name is universally unique, clients can depend upon consistent behavior for a particular property across multiple resources, on the same and across different servers, so long as that property is "live" onclient; theresources in question, andserver merely records theimplementationvalue of thelive property is faithful to its definition. The XML namespace mechanism, which is based on URIs [6], is used to name properties because it prevents namespace collisions and provides for varying degrees of administrative control. The property namespace is flat; that is, no hierarchy of properties is explicitly recognized. Thus, if apropertyAverbatim. 4.2 Properties and HTTP Headers Properties already exist, in aproperty A/B exist onlimited sense, in HTTP message headers. However, in distributed authoring environments aresource, there is no recognitionrelatively large number ofany relationship between the two properties. It is expected that a separate specification will eventually be produced which will address issues relating to hierarchical properties. Finally, it is not possibleproperties are needed todefine the same property twice on a single resource, as this would cause a collision indescribe theresource's property namespace. Dusseault & Crawford Expires January 15, 2005 [Page 9] Internet-Draft RFC2518bis July 2004 5. Collections of Web Resources This section provides a descriptionstate of anew type of Webresource,the collection,anddiscusses its interactions with thesetting/returning them all through HTTPURL namespace. The purpose ofheaders is inefficient. Thus acollection resourcemechanism is needed which allows a principal tomodel collection-like objects (e.g., file system directories) withinidentify aserver's namespace. All DAV compliant resources MUST supportset of properties in which theHTTP URL namespace model specified herein. 5.1 HTTP URL Namespace Model The HTTP URL namespace is a hierarchical namespace where the hierarchy is delimited with the "/" character. An HTTP URL namespaceprincipal issaidinterested and tobe consistent if it meets the following conditions: for every URLset or retrieve just those properties. 4.3 XML Usage In HTTP/1.1, method parameter information was exclusively encoded intheHTTPhierarchy there exists a collection that contains that URL asheaders. Unlike HTTP/1.1, WebDAV encodes method parameter information either in aninternal member. The root,XML [11] request entity body, ortop-level collectionin an HTTP header. The use of XML to encode method parameters was motivated by thenamespace under considerationability to add extra XML elements to existing structures, providing extensibility; and by XML's ability to encode information in ISO 10646 character sets, providing internationalization support. In addition to encoding method parameters, XML isexempt from the previous rule. Neither HTTP/1.1 norused in WebDAVrequire thatto Dusseault & Crawford Expires January 16, 2006 [Page 11] Internet-Draft RFC2518bis July 2005 encode theentire HTTP URL namespace be consistent. However, certain WebDAV methods are prohibitedresponses fromproducing results that causemethods, providing the extensibility and internationalization advantages of XML for method output, as well as input. The XML namespaceinconsistencies. Although implicitextension [10] is also used inRFC2616 [8]this specification in order to allow for new XML elements to be added without fear of colliding with other element names. Although WebDAV request andRFC2396 [6], any resource, including collection resources, MAYresponse bodies can beidentifiedextended bymore than one URI. For example, a resource couldarbitrary XML elements, which can beidentifiedignored bymultiple HTTP URLs. 5.2 Collection Resources A collectionthe message recipient, an XML element in the "DAV:" namespace SHOULD NOT be used in the request or response body unless that XML element isa resource whose state consists of at least a list of internal member URLs and a set of properties, but which may have additional state such as entity bodies returnedexplicitly defined in an IETF RFC reviewed byGET. An internal member URL MUST be immediately relative toabase URL of the collection. That is, the internal member URLWebDAV working group. Note that "DAV:" isequala scheme name defined solely to provide acontaining collection's URL plus an additional segment for non- collection resources, or additional segment plus trailing slash "/"namespace forcollection resources, where segmentWebDAV XML elements and property names. This practice isdefineddiscouraged insection 3.3part because registration ofRFC2396 [6]. Any given internal member URL MUST only belong to the collection once, i.e., itnew scheme names isillegal to have multiple instances of the same URL in a collection. Propertiesdifficult. "DAV:" was definedon collections behave exactlyasdo properties on non-collection resources. Dusseault & Crawford Expires January 15, 2005 [Page 10] Internet-Draft RFC2518bis July 2004 For allthe WebDAVcompliant resources A and B, identified by URLs Unamespace before standard best practices emerged, andV, for which Uthis namespace isimmediately relative to V, B MUSTkept and still used because of significant existing deployments, but this should not bea collection that has U as an internal member URL. So, if the resource with URL http://example.com/bar/blahemulated. 4.4 Property Values The value of a property isWebDAV compliant and if the resource with URL http://example.com/bar/always a (well-formed) XML fragment. XML has been chosen because it isWebDAV compliant then the resource with URL http://example.com/bar/ must beacollectionflexible, self-describing, structured data format that supports rich schema definitions, andmust contain URL http://example.com/bar/blah as an internal member. Collection resources MAY list the URLsbecause ofnon-WebDAV compliant children in the HTTP URL namespace hierarchy as internal members but are not requiredits support for multiple character sets. XML's self- describing nature allows any property's value todo so. For example, if the resource with URL http://example.com/bar/blah is not WebDAV compliant and the URL http://example.com/bar/ identifies a collection then URL http:// example.com/bar/blah may or may notbean internal member ofextended by adding new elements. Older clients will not break when they encounter extensions because they will still have thecollection with URL http://example.com/bar/. If a WebDAV compliant resource has no WebDAV compliant childrendata specified in theHTTP URL namespace hierarchy then the WebDAV compliant resource isoriginal schema and will ignore elements they do notrequiredunderstand. XML's support for multiple character sets allows any human-readable property to be encoded and read in acollection. There is a standing convention that when a collection is referredcharacter set familiar toby its name without a trailing slash,theserver MAY handleuser. XML's support for multiple human languages, using therequest as if"xml:lang" attribute, handles cases where thetrailing slash were present. In this case it SHOULD return a Content-Location header in the response, pointing to the URL ending with the "/". For example, if a client invokessame character set is employed by multiple human languages. Note that xml:lang scope is recursive, so amethod on http://example.bar/blah (no trailing slash), the server may respond as if the operation were invokedxml:lang attribute onhttp://example.com/blah/ (trailing slash), and should returnany element containing aContent-Location header withproperty name element applies to the property valuehttp://example.bar/blah/. Wherever a server produces a URL referring tounless it has been overridden by acollection, the server MUST include the trailing slash. In general clients SHOULD use the "/" form of collection names.more locally scoped attribute. Aresource MAY be a collection but not be WebDAV compliant. That is, the resource may complyproperty is always represented in XML withallan XML element consisting of therules set out in this specification regarding how a collectionproperty name. The simplest example isto behave without necessarily supporting all methods that a WebDAV compliant resourcean empty property, which isrequired to support. In suchdifferent from acase the resource may return the DAV:resourcetypepropertywith thethat does not exist. <R:title xmlns:R="http://www.example.com/ns/"></R:title> The valueDAV:collection but MUST NOT returnof aDAV header containing the value "1" on an OPTIONS response. Clients MUST be able to support the case where WebDAV resources are containedproperty appears insidenon-WebDAV resources. For example, if a OPTIONS response from "http://example.com/servlet/dav/collection" indicates WebDAV support,theclient cannot assume that "http://example.com/ servlet/dav/" or its parent necessarily are WebDAV collections.property name element. Dusseault & Crawford Expires January15, 200516, 2006 [Page11]12] Internet-Draft RFC2518bis July2004 5.3 Source Resources and Output Resources For many resources, the entity returned by a GET method exactly matches the persistent state of the resource, for example, a GIF file stored on a disk. For this simple case, the URL at which a resource is accessed is identical to the URL at which the source (the persistent state)2005 The value may be any kind of well-formed XML content, including both text-only and mixed content. When theresource is accessed. This is also the case for HTML source filesproperty value contains further XML elements, namespaces that arenot processed byin scope for that part of theserver prior to transmission. However,XML document apply within theserver can sometimes process HTML resources before they are transmittedproperty value asa return entity body. For example, a server- side-include directive within an HTML file might instruct awell, and MUST be preserved in server storage for retransmission later. Namespace prefixes need not be preserved due toreplacethedirective with another value, such asrules of prefix declaration in XML. Attributes on thecurrent date. In this case, what is returned by GET (HTML plus date) differs fromproperty name element may convey information about thepersistent stateproperty, but are not considered part of theresource (HTML plus directive). Typically there is no way to access the HTML resource containingvalue. However, when language information appears in theunprocessed directive. Sometimes'xml:lang' attribute on theentity returned by GET isproperty name element, theoutput of a data- producing processlanguage information MUST be preserved in server storage for retransmission later. Note thatis described bya property only has oneor more source resources (that mayvalue, in one language (or language MAY be left undefined), noteven have a locationmultiple values inthe URI namespace). A single data-producing process may dynamically generate the state ofdifferent languages or apotentially large number of output resources. An example of thissingle value in multiple languages. The XML attribute xml:space MUST NOT be used to change white space handling. White space in property values is significant. 4.5 Property Names A property name is aCGI scriptuniversally unique identifier thatdescribesis associated with a"finger" gateway processschema thatmaps part ofprovides information about thenamespacesyntax and semantics of the property. Because aserver into finger requests, such as http:// finger.example.com/finger_gateway/user@host. Although this problem would usefully be solved, interoperable WebDAV implementations have been widely deployed without actually solving this problem. Thus,property's name is universally unique, clients can depend upon consistent behavior for a particular property across multiple resources, on thesource vs. output problemsame and across different servers, so long as that property isnot solved"live" on the resources inthis specification,question, andhas been deferredthe implementation of the live property is faithful toa separate document. Dusseault & Crawford Expires January 15, 2005 [Page 12] Internet-Draft RFC2518bis July 2004 6. Lockingits definition. TheabilityXML namespace mechanism, which is based on URIs [5], is used tolock a resourcename properties because it prevents namespace collisions and providesa mechanismforserializing access tovarying degrees of administrative control. The property namespace is flat; thatresource. Usingis, no hierarchy of properties is explicitly recognized. Thus, if alock, an authoring client can provideproperty A and areasonable guarantee that another principal will not modifyproperty A/B exist on aresource while itresource, there isbeing edited. In this way, a client can prevent the "lost update" problem. Thisno recognition of any relationship between the two properties. It is expected that a separate specificationallows lockswill eventually be produced which will address issues relating tovary over two client-specified parameters,hierarchical properties. Finally, it is not possible to define thenumber of principals involved (exclusive vs. shared)same property twice on a single resource, as this would cause a collision in the resource's property namespace. Dusseault & Crawford Expires January 16, 2006 [Page 13] Internet-Draft RFC2518bis July 2005 4.6 Source Resources and Output Resources Some HTTP resources are dynamically generated by thetypeserver. For these resources, there presumably exists source code somewhere governing how that resource is generated. The relationship ofaccesssource files to output HTTP resources may begranted. This document defines locking for onlyoneaccess type, write. However, the syntax is extensible, and permits the eventual specification of locking for other access types. 6.1 Exclusive Vs. Shared Locks The most basic form of lock is an exclusive lock. Onlyto one, oneexclusive lock may exist on any resource,to many, many to one or many to many. There is no mechanism in HTTP to determine whetherita resource isdirectlyeven dynamic, let alone where its source files exist orindirectly locked (Section 7.5). Exclusive locks avoid havinghow tomerge results,author them. Although this problem would usefully be solved, interoperable WebDAV implementations have been widely deployed withoutrequiring any coordination other than the methods described inactually solving thisspecification. However, there are times whenproblem, by dealing only with static resources. Thus, thegoal of a locksource vs. output problem is not solved in this specification and has been deferred toexclude others from exercising an access right but rather to provideamechanism for principals to indicate that they intend to exercise their access rights. Shared locks are provided for this case. A shared lock allows multiple principals to receiveseparate document. Dusseault & Crawford Expires January 16, 2006 [Page 14] Internet-Draft RFC2518bis July 2005 5. Collections of Web Resources This section provides alock. Hence any principaldescription of a new type of Web resource, the collection, and discusses its interactions withappropriate access can usethelock. With shared locks there are two trust sets that affect a resource.HTTP URL namespace. Thefirst trust setpurpose of a collection resource iscreated by access permissions. Principals who are trusted, for example, may have permission to write to the resource. Among those who have access permission to writetothe resource, the set of principals who have taken outmodel collection-like objects (e.g., file system directories) within ashared lock also must trust each other, creatingserver's namespace. All DAV compliant resources MUST support the HTTP URL namespace model specified herein. 5.1 HTTP URL Namespace Model The HTTP URL namespace is a(typically) smaller trust set withinhierarchical namespace where theaccess permission write set. Startinghierarchy is delimited withevery possible principal ontheInternet,"/" character. An HTTP URL namespace is said to be consistent if it meets the following conditions: for every URL inmost situationsthevast majority of these principals will not have write access toHTTP hierarchy there exists agiven resource. Of the small number who do have write access, some principals may decide to guarantee their edits are freecollection that contains that URL as an internal member. The root, or top-level collection of the namespace under consideration is exempt fromoverwrite conflictsthe previous rule. The top-level collection of the namespace under consideration is not necessarily the collection identified byusing exclusive write locks. Othersthe absolute path '/', it may be identified by one or more path segments (e.g. /servlets/webdav/...) Neither HTTP/1.1 nor WebDAV require that the entire HTTP URL namespace be consistent -- a WebDAV-compatible resource maydecide they trust their collaborators willnotoverwrite their work (the potential sethave a parent collection. However, certain WebDAV methods are prohibited from producing results that cause namespace inconsistencies. Although implicit in RFC2616 [7] and RFC2396 [5], any resource, including collection resources, MAY be identified by more than one URI. For example, a resource could be identified by multiple HTTP URLs. 5.2 Collection Resources A collection is a resource whose state consists ofcollaborators being the setat least a list ofprincipals who have write permission)internal member URLs anduseashared lock,set of properties, but whichinforms their collaborators that a principalmay have additional state such as entity bodies returned by GET. An internal member URL MUST beworking onimmediately relative to a base URL of theresource.collection. That is, the internal member URL is equal to a containing collection's URL plus an additional segment for non- collection resources, or additional segment plus trailing slash "/" for collection resources, where segment is defined in section 3.3 of RFC2396 [5]. Any given internal member URL MUST only belong to the collection Dusseault & Crawford Expires January15, 200516, 2006 [Page13]15] Internet-Draft RFC2518bis July2004 The WebDAV extensions to HTTP do not need to provide all of the communications paths necessary for principals2005 once, i.e., it is illegal tocoordinate their activities. When using shared locks, principals may use any outhave multiple instances ofband communication channel to coordinate their work (e.g., face-to- face interaction, written notes, post-it notes onthescreen, telephone conversation, Email, etc.) The intent ofsame URL in ashared lockcollection. Properties defined on collections behave exactly as do properties on non-collection resources. For all WebDAV compliant resources A and B, identified by URLs U and V, for which U is immediately relative tolet collaborators know who else mayV, B MUST beworking onaresource. Shared locks are included because experience from web distributed authoring systems has indicatedcollection thatexclusive locks are often too rigid. An exclusive lock is used to enforce a particular editing process: take outhas U as anexclusive lock, read the resource, perform edits, writeinternal member URL. So, if theresource, releaseresource with URL http://example.com/bar/blah is WebDAV compliant and if thelock. This editing process hasresource with URL http://example.com/bar/ is WebDAV compliant then theproblem that locks are not always properly released, for example when a program crashes, or when a lock owner leaves without unlockingresource with URL http://example.com/bar/ must be aresource. While both timeoutscollection andadministrative action can be used to removemust contain URL http://example.com/bar/blah as anoffending lock, neither mechanism may be available when needed; the timeout may be long orinternal member. Collection resources MAY list theadministrator may not be available. 6.2 Required Support A WebDAVURLs of non-WebDAV compliantresource ischildren in the HTTP URL namespace hierarchy as internal members but are not required tosupport locking in any form. Ifdo so. For example, if the resourcedoes support locking it may choose to support any combination of exclusive and shared locks for any access types. The reason for this flexibilitywith URL http://example.com/bar/blah isthat locking policy strikes tonot WebDAV compliant and thevery heartURL http://example.com/bar/ identifies a collection then URL http://example.com/bar/blah may or may not be an internal member of the collection with URL http://example.com/bar/. If a WebDAV compliant resourcemanagement and versioning systems employed by various storage repositories. These repositories require control over what sort of locking will be made available. For example, some repositories only support shared write locks while others only provide support for exclusive write locks while yet others usehas nolocking at all. As each system is sufficiently different to merit exclusion of certain locking features, this specification leaves locking asWebDAV compliant children in thesole axis of negotiation within WebDAV. 6.3 Lock Tokens A lock tokenHTTP URL namespace hierarchy then the WebDAV compliant resource is not required to be atype of state token, represented ascollection. There is aURI, which identifiesstanding convention that when aparticular lock. A lock tokencollection isreturned in the Lock- Token header in the responsereferred to by its name without asuccessful LOCK operation. The lock token also appears intrailing slash, thevalue ofserver MAY handle thelockdiscovery property,request as if thevalue of which is returnedtrailing slash were present. In this case it SHOULD return a Content-Location header in thebody of the responseresponse, pointing toa successful LOCK operation (this property also includesthetokens of other current locksURL ending with the "/". For example, if a client invokes a method on http://example.bar/blah (no trailing slash), theresource). Finally,server may respond as if thelockdiscovery property can be queried using PROPFINDoperation were invoked on http://example.com/blah/ (trailing slash), and should return a Content-Location header with thetoken canvalue http://example.bar/blah/. Wherever a server produces a URL referring to a collection, the server MUST include the trailing slash. In general clients SHOULD use the "/" form of collection names. Clients MUST bediscoveredable to support the case where WebDAV resources are contained inside non-WebDAV resources. For example, if a OPTIONS response from "http://example.com/servlet/dav/collection" indicates WebDAV support, the client cannot assume thatway. Each lock has only one unique lock token."http://example.com/servlet/dav/" or its parent necessarily are WebDAV collections. Dusseault & Crawford Expires January15, 200516, 2006 [Page14]16] Internet-Draft RFC2518bis July2004 Lock token URIs MUST be unique across all resources for all time. This uniqueness constraint allows lock tokens to be submitted across resources and servers without fear of confusion. This specification provides a lock token URI scheme called opaquelocktoken that meets the uniqueness requirements. However resources are free to return any URI scheme so long as it meets the uniqueness requirements.2005 6. Locking TheIETF recommends using registered URI schemesability toensure uniqueness. Having alocktokena resource providesno speciala mechanism for serializing accessrights. Anyoneto that resource. Using a lock, an authoring client canfind out anyone else's lock token by performing lock discovery. Locks MUST be enforced based upon whatever authentication mechanismprovide a reasonable guarantee that another principal will not modify a resource while it isused bybeing edited. In this way, a client can prevent theserver, not based on"lost update" problem. This specification allows locks to vary over two client-specified parameters, thesecrecynumber of principals involved (exclusive vs. shared) and thetoken values. 6.4 opaquelocktoken Lock Token URI Scheme The opaquelocktoken URI scheme is designedtype of access to beunique across all resourcesgranted. This document defines locking forall time. Due to this uniqueness quality, a client may submit an opaqueonly one access type, write. However, the syntax is extensible, and permits the eventual specification of locking for other access types. 6.1 Exclusive Vs. Shared Locks The most basic form of locktoken inis anIf headerexclusive lock. Only one exclusive lock may exist ona resourceany resource, whether it is directly or indirectly locked (Section 7.7). Exclusive locks avoid having to merge results, without requiring any coordination other than theone that returned it. In order to guarantee uniqueness across all resources for all time the opaquelocktoken requires the use of the Universal Unique Identifier (UUID) mechanism, asmethods described inISO-11578 [12]. Opaquelocktoken generators, however, have a choicethis specification. However, there are times when the goal ofhow they create these tokens. They can either generateanew UUID for everylocktoken they create or they can create a single UUID and then add extension characters. If the second method is selected then the program generating the extensions MUST guarantee that the same extension will never be used twice with the associated UUID. OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension] ; The UUID production is the string representation of a UUID, as defined in ISO-11578 [12]. Note that white space (LWS)is notallowed between elements of this production. Extension = path ; path is defined in section 3.3 of RFC2396 [6] 6.5 Lock Capability Discovery Since server lock support is optional, a client tryingtolock a resource onexclude others from exercising an access right but rather to provide aserver can either try the lock and hopemechanism forthe best, or perform some form of discoveryprincipals todetermine what lock capabilities the server supports. This is known as lock capability discovery.indicate that they intend to exercise their access rights. Shared locks are provided for this case. Aclient can determine whatshared locktypes the server supports by retrieving the supportedlock property. Dusseault & Crawford Expires January 15, 2005 [Page 15] Internet-Draft RFC2518bis July 2004 Any DAV compliant resource that supports the LOCK method MUST support the supportedlock property. 6.6 Active Lock Discovery If anotherallows multiple principals to receive a lock. Hence any principal with appropriate access can use the lock. With shared locksa resourcethere are two trust sets that affect aprincipal wishes to access, itresource. The first trust set isusefulcreated by access permissions. Principals who are trusted, forthe second principalexample, may have permission tobe ablewrite tofind outthe resource. Among those who have access permission to write to thefirst principal is. For this purposeresource, thelockdiscovery property is provided. This property lists all outstanding locks, describes their type, and where available, provides theirset of principals who have taken out a shared locktoken. Any DAV compliant resource that supportsalso must trust each other, creating a (typically) smaller trust set within theLOCK method MUST supportaccess permission write set. Starting with every possible principal on thelockdiscovery property. 6.7 Avoiding Lost Updates AlthoughInternet, in most situations thelocking mechanisms specified here providevast majority of these principals will not have write access to a given resource. Of the small number who do have write access, somehelp in preventing lost updates, they cannotprincipals may decide to guaranteethat updatestheir edits are free from overwrite conflicts by using exclusive write locks. Others may decide they trust their collaborators willnever be lost. Considernot overwrite their work (the potential set of collaborators being thefollowing scenario: Two clients Aset of principals who have write permission) andB are interested in editing the resource 'index.html'. Client A is an HTTP client rather thanuse a shared lock, which informs their collaborators that a principal may be working on the resource. Dusseault & Crawford Expires January 16, 2006 [Page 17] Internet-Draft RFC2518bis July 2005 The WebDAVclient, and so doesextensions to HTTP do notknow howneed toperform locking. Client A doesn't lock the document, but does a GET and begins editing. Client B does LOCK, performs a GET and begins editing. Client B finishes editing, performs a PUT, then an UNLOCK. Client A performs a PUT, overwriting and losingprovide all ofB's changes. There are several reasons whytheWebDAV protocol itself cannot prevent this situation. First, it cannot force all clientscommunications paths necessary for principals to coordinate their activities. When using shared locks, principals may uselocking because it must be compatible with HTTP clients that do not comprehend locking. Second, it cannot require servers to support locking becauseany out of band communication channel to coordinate their work (e.g., face-to- face interaction, written notes, post-it notes on thevariety of repository implementations, somescreen, telephone conversation, Email, etc.) The intent ofwhich rely on reservations and merging rather thana shared lock is to let collaborators know who else may be working onlocking. Finally, being stateless, it cannot enforceasequence of operations like LOCK / GET / PUT / UNLOCK. WebDAV serversresource. Shared locks are included because experience from web distributed authoring systems has indicated thatsupport locking can reduceexclusive locks are often too rigid. An exclusive lock is used to enforce a particular editing process: take out an exclusive lock, read thelikelihoodresource, perform edits, write the resource, release the lock. This editing process has the problem thatclients will accidentally overwrite each other's changes by requiring clients tolocks are not always properly released, for example when a program crashes, or when a lockresources before modifying them. Such servers would effectively prevent HTTP 1.0owner leaves without unlocking a resource. While both timeouts andHTTP 1.1 clients from modifying resources. Dusseault & Crawford Expires January 15, 2005 [Page 16] Internet-Draft RFC2518bis July 2004 WebDAV clientsadministrative action can begood citizens by using a lock / retrieve / write /unlock sequence of operations (at least by default) whenever they interact with a WebDAV server that supports locking. HTTP 1.1 clients can be good citizens, avoiding overwriting other clients' changes, by using entity tags in If-Match headers with any requests that would modify resources. Information managers may attemptused toprevent overwrites by implementing client-side procedures requiring locking before modifying WebDAV resources. 6.8 Locks and Multiple Bindings A resourceremove an offending lock, neither mechanism may bemadeavailablethrough more than one URI. However locks apply to resources, not URIs. Therefore a LOCK request on a resource MUST NOT succeed if can not be honored by allwhen needed; theURIs through whichtimeout may be long or the administrator may not be available. 6.2 Required Support A WebDAV compliant resource isaddressable. Dusseault & Crawford Expires January 15, 2005 [Page 17] Internet-Draft RFC2518bis July 2004 7. Write Lock This section describes the semantics specificnot required to support locking in any form. If thewrite lock type. The write lock is a specific instanceresource does support locking it may choose to support any combination ofa lock type,exclusive andis the only lock type described in this specification. Writeshared locksprevent unauthorized changesfor any access types. The reason for this flexibility is that locking policy strikes toresources. In general terms, changes affected by write locks include changes to: othecontentvery heart of the resourceo any dead propertymanagement and versioning systems employed by various storage repositories. These repositories require control over what sort ofthe resource o any live property defined tolocking will belockable (all properties defined inmade available. For example, some repositories only support shared write locks while others only provide support for exclusive write locks while yet others use no locking at all. As each system is sufficiently different to merit exclusion of certain locking features, this specificationare lockable) oleaves locking as thedirect membershipsole axis ofthe resource, if itnegotiation within WebDAV. 6.3 Lock Tokens A lock token is acollection o the URL/locationtype of state token, represented as aresource The next few sections describe in more specific terms how write locks interact with various operations. 7.1 Methods Restricted by Write Locks A write lock MUST preventURI, which identifies aprincipal without theparticular lock. A lockfrom successfully executing a PUT, POST, PROPPATCH, LOCK, UNLOCK, MOVE, DELETE, or MKCOL ontoken is returned in thelocked resource. All other current methods, GETLock- Token header inparticular, function independently ofthelock. Note, however, that as new methods are created it will be necessaryresponse tospecify how they interact withawrite lock. 7.2 Write Locks and Lock Tokens Asuccessfulrequest for an exclusive or shared writeLOCK operation. The lockMUST resulttoken also appears in thegenerationvalue ofa unique lock token associated withtherequesting principal. Thus if five principals have a shared write lock onlockdiscovery property, thesame resource there will be five lock tokens, one for each principal. 7.3 Write Locks and Properties While those without a write lock may not alter a property on a resource itvalue of which isstill possible forreturned in thevaluesbody oflive properties to change, even while locked, duethe response to a successful LOCK operation (this property also includes therequirementstokens oftheir schemas. Only dead properties and live properties defined to respectother current locksare guaranteed not to change while write locked. 7.4 Write Lockson the resource). Finally, the lockdiscovery property can be queried using PROPFIND andUnmapped URLs It is possible tothe token can be discovered that way. Each lockan unmapped URL in order tohas only one unique lockthe name fortoken. Dusseault & Crawford Expires January15, 200516, 2006 [Page 18] Internet-Draft RFC2518bis July2004 use.2005 Lock token URIs MUST be unique across all resources for all time. Thisis a simple wayuniqueness constraint allows lock tokens toavoid the lost-update problem on the creationbe submitted across resources and servers without fear of confusion. This specification provides anew resource (another way is to use If-None-Match header specified in HTTP 1.1). It haslock token URI scheme called opaquelocktoken that meets theside benefit of lockinguniqueness requirements. However resources are free to return any URI scheme so long as it meets thenew resource immediately foruniqueness requirements. According to current IETF best practices, implementations SHOULD useof the creator. The lost-update problem is not an issue for collections because MKCOL can only be usedregistered URI schemes tocreateensure uniqueness. Submitting acollection, not to overwrite an existing collection. In order to immediatelylocka collection upon creation, clients may attempttoken does not confer full privilege topipelineuse theMKCOL and LOCK requests together. Alockrequest to an unmapped URL SHOULD result intoken or modify thecreation of anlockedresource with empty content. A subsequent PUT request with the correctresource. Anyone can find out anyone else's lock tokenSHOULD normally succeed, and this new request provides the content, content-type, content-languageby performing lock discovery. Write access and otherinformation as appropriate. In this situation, a WebDAV server that was implemented from RFC2518 MAY create "lock-null" resources which are special and unusual resources. Historically, a lock-null resource: o Responds with a 404privileges MUST be enforced through normal privilege or405 to any DAV method except for PUT, MKCOL, OPTIONS, PROPFIND, LOCK, UNLOCK. o Appears as a memberauthentication mechanisms, not based on the slight obscurity ofits parent collection. o Disappears (URI becomes unmapped) if itslockgoes away before it is converted to a regular resource. (This must also happen if it is renamed or moved, or if any parent collection is renamed or moved, because lockstoken values. Since lock tokens aretied to URLs). o May be turned intounique, aregular resource whenclient MAY submit aPUT request tolock token in an If header on a resource other than theURL is successful. Ceasesone that returned it. 6.4 Lock Token URI Schemes In order tobe a lock-null resource. o May be turned into a collection whenguarantee uniqueness across all resources for all time aMKCOL requestserver MAY use the Universal Unique Identifier (UUID) [9] mechanism to generate a lock token: urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 The 'opaquelocktoken' URI scheme extends theURL is successful. CeasesUUID mechanism slightly while still guaranteeing the lock token to bea lock-null resource. o Has defined valuesunique across all resources forlockdiscovery and supportedlock properties. However, interoperability and compliance problems have been found with lock-null resources. Therefore, they are deprecated. WebDAV servers SHOULD create regular locked empty resources, which are and behave in every way as normal resources. A locked empty resource: o Can be read, deleted, moved, copied, and inallways behave as a regular resource, nottime. With the 'opaquelocktoken' scheme, the server MAY reuse alock-null resource. o Appears asUUID with extension characters added. If the server does this then the algorithm generating the extensions MUST guarantee that the same extension will never be used twice with the associated UUID. OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension] ; The UUID production is the string representation of amemberUUID. Note that white space (LWS) is not allowed between elements ofits parent collection. o SHOULD NOT disappear when itsthis production. Extension = path ; path is defined in section 3.3 of RFC2396 [5] 6.5 Lock Capability Discovery Since server lockgoes away (clients must therefore be responsible for cleaning up their own mess, as with any other operation) o SHOULD defaultsupport is optional, a client trying tohaving no content type. o MAY NOT have valueslock a resource on a server can either try the lock and hope forproperties like getcontentlanguage which haven't been specified yet bytheclient.best, or perform some form of discovery to determine what lock capabilities Dusseault & Crawford Expires January15, 200516, 2006 [Page 19] Internet-Draft RFC2518bis July2004 o May have content added with a PUT request. MUST be able to change content type. o MUST NOT be turned into a collection. A MKCOL request must fail2005 the server supports. This is known asit would to any existing resource. o MUST have defined values for lockdiscovery andlock capability discovery. A client can determine what lock types the server supports by retrieving the supportedlockproperties. o The response MUST indicate that aproperty. Any DAV compliant resourcewas created, by use ofthat supports the"201 Created" response code (aLOCKrequest to an existing resource instead will result in 200 OK). The body must still includemethod MUST support thelockdiscovery property, as withsupportedlock property. 6.6 Active Lock Discovery If another principal locks aLOCK requestresource that a principal wishes toan existing resource. The clientaccess, it isexpecteduseful for the second principal toupdatebe able to find out who thelocked empty resource shortly after locking it, using PUTfirst principal is. For this purpose the lockdiscovery property is provided. This property lists all outstanding locks, describes their type, andpossibly PROPPATCH. Whenwhere available, provides their lock token. Any DAV compliant resource that supports theclient uses PUTLOCK method MUST support the lockdiscovery property. 6.7 Locks and Multiple Bindings A resource may be made available through more than one URI. However locks apply tooverwriteresources, not URIs. Therefore a LOCK request on alocked emptyresourcethe clientMUSTsupply a Content-TypeNOT succeed ifany is known. Ifcan not be honored by all theclient supplies a Content- Type valueURIs through which theserver MUST set that value (this requirement actually applies to anyresourcethat is overwritten butisparticularly necessary for locked empty resources which are initially created with no Content-Type. Clients can easily interoperate both with servers that support the deprecated lock-null resources and servers that support simpler locked empty resources by only attempting PUT after a LOCK to an unmapped URL, not MKCOL or GET. 7.5addressable. Dusseault & Crawford Expires January 16, 2006 [Page 20] Internet-Draft RFC2518bis July 2005 7. WriteLocksLock This section describes the semantics specific to the write lock type. The write lock is a specific instance of a lock type, andCollections Ais the only lock type described in this specification. An exclusive write lockonwill prevent parallel changes to acollection, whether createdresource bya "Depth: 0" or "Depth: infinity"any principal other than the write lockrequest, preventsholder. In general terms, changes affected by write locks include changes to: o theaddition or removalcontent ofmember URLsthe resource o any dead property of thecollection by non-lock owners. A zero-depth lock on a collection affects changesresource o any live property defined to be lockable (all properties defined in this specification are lockable) o the direct membership ofthat collection. When a principal issuesthe resource, if it is aPUT or POST request to createcollection o the URL/location of anewresource The next few sections describe inamore specific terms how writelocked collection, or issues a DELETE to an existing internal member URLlocks interact with various operations. 7.1 Lock Owner The creator ofa write locked collection, this request MUST fail iftheprincipal does not provide the correctlocktoken foris thelocked collection. In addition, a depth-infinitylockaffects all write operations to all descendents of the locked collection. With a depth-infinity lock,owner. The server MUST restrict therootusage of the lockis directly locked, and alltoken to the lock owner (both for shared and exclusive locks -- for multi-user shared lock cases, each authenticated principal MUST obtain itsdescendants are indirectly locked. o Any newown shared lock). The server MAY allow privileged users other than the lock owner to destroy a lock (for example, the resourceaddedowner or an administrator) as adescendentspecial case of lock usage. If an anonymous user requests adepth-infinity locked collection becomes indirectly locked. o Any indirectly lockedlock, the server MAY refuse the request. 7.2 Methods Restricted by Write Locks A server MUST reject any write request that alters a write-locked resourcemoved outunless a valid lock token is provided. The write operations defined in HTTP and WebDAV are PUT, POST, PROPPATCH, LOCK, UNLOCK, MOVE, COPY (for the destination resource), DELETE, and MKCOL. All other HTTP/WebDAV methods, GET in particular, function independently of thelocked collection into an unlocked collection is thereafter unlocked.lock. A shared write lock prevents the same operations, however it also allows access by any principal that has a shared write lock on the same resource. Dusseault & Crawford Expires January15, 200516, 2006 [Page20]21] Internet-Draft RFC2518bis July2004 o Any indirectly locked resource moved out of a locked source collection into2005 Note, however, that as new methods are created it will be necessary to specify how they interact with adepth-infinity locked target collection remains indirectly locked but is now withinwrite lock. 7.3 Write Locks and Lock Tokens A successful request for an exclusive or shared write lock MUST result in thescopegeneration of a unique lock token associated with the requesting principal. Thus if five principals have a shared write lock on thetarget collection (the target collection's lock tokensame resource there willthereafterberequired to make further changes). If a depth-infinity write LOCK request is issued to a collection containing member URLs identifying resources that are currently locked infive lock tokens, one for each principal. 7.4 Write Locks and Properties While those without amanner which conflicts with thewritelock, the request MUST fail withlock may not alter a423 (Locked) status code, and the response SHOULD contain the 'missing-lock-token' precondition. Ifproperty on alock owner causesresource it is still possible for theURLvalues ofa resourcelive properties tobe added as an internal member URL of a depth-infinity locked collection then the new resource MUST be automatically addedchange, even while locked, due to thelock. This is the only mechanism that allows a resourcerequirements of their schemas. Only dead properties and live properties defined tobe addedrespect locks are guaranteed not toachange while writelock. Thus, for example, iflocked. 7.5 Avoiding Lost Updates Although thecollection /a/b/ iswritelocked and the resource /c is moved to /a/b/c then resource /a/b/clocks provide some help in preventing lost updates, they cannot guarantee that updates will never beadded tolost. Consider thewrite lock. 7.6 Write Locksfollowing scenario: Two clients A and B are interested in editing theIf Request Header If a user agentresource 'index.html'. Client A is an HTTP client rather than a WebDAV client, and so does notrequiredknow how tohave knowledge about aperform locking. Client A doesn't lockwhen requesting an operation on a locked resource,thefollowing scenario might occur. Program A, run by User A, takes outdocument, but does awrite lock onGET and begins editing. Client B does LOCK, performs aresource. Program B, also run by User A, has no knowledge of the lock taken out by Program A, yetGET and begins editing. Client B finishes editing, performs aPUT toPUT, then an UNLOCK. Client A performs a PUT, overwriting and losing all of B's changes. There are several reasons why thelocked resource. InWebDAV protocol itself cannot prevent thisscenario, the PUT succeedssituation. First, it cannot force all clients to use locking becauselocks are associatedit must be compatible witha principal,HTTP clients that do nota program, and thus program B, becausecomprehend locking. Second, itis acting with principal Aȡs credential, is allowedcannot require servers toperform the PUT. However, had program B known aboutsupport locking because of thelock,variety of repository implementations, some of which rely on reservations and merging rather than on locking. Finally, being stateless, itwould not have overwritten the resource, preferring instead to presentcannot enforce adialog box describing the conflict tosequence of operations like LOCK / GET / PUT / UNLOCK. WebDAV servers that support locking can reduce theuser. Due to this scenario, a mechanism is needed to prevent different programs fromlikelihood that Dusseault & Crawford Expires January 16, 2006 [Page 22] Internet-Draft RFC2518bis July 2005 clients will accidentallyignoring locks taken outoverwrite each other's changes byother programs with the same authorization. In orderrequiring clients toprevent these collisions alocktoken MUST be submitted by an authorized principal for all lockedresourcesthatbefore modifying them. Such servers would effectively prevent HTTP 1.0 and HTTP 1.1 clients from modifying resources. WebDAV clients can be good citizens by using amethod may change or the method MUST fail. Alocktoken is submitted when it appears in an If header. For example, if/ retrieve / write /unlock sequence of operations (at least by default) whenever they interact with aresource is to be moved and both the source and destination are locked then two lock tokens mustWebDAV server that supports locking. HTTP 1.1 clients can besubmitted in the if header, one for the source and thegood citizens, avoiding overwriting otherfor the destination. Dusseault & Crawford Expires January 15, 2005 [Page 21] Internet-Draft RFC2518bis July 2004 Example -clients' changes, by using entity tags in If-Match headers with any requests that would modify resources. Information managers may attempt to prevent overwrites by implementing client-side procedures requiring locking before modifying WebDAV resources. 7.6 WriteLock >>Request COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html If: <http://www.ics.uci.edu/users/f/fielding/index.html> (<opaquelocktoken:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>) >>Response HTTP/1.1 204 No Content In this example, even though both the sourceLocks anddestination are locked, only oneUnmapped URLs It is possible to locktoken must be submitted,an unmapped URL in order to lock the name for use. This is a simple way to avoid thelocklost-update problem on thedestination. Thiscreation of a new resource (another way isbecauseto use If-None-Match header specified in HTTP 1.1). It has thesourceside benefit of locking the new resource immediately for use of the creator. The lost-update problem is notmodified byan issue for collections because MKCOL can only be used to create aCOPY, and hence unaffected by the write lock.collection, not to overwrite an existing collection. Inthis example, user agent authentication has previously occurred viaorder to immediately lock amechanism outside the scope of the HTTP protocol, incollection upon creation, clients may attempt to pipeline theunderlying transport layer. 7.7 Write LocksMKCOL andCOPY/MOVELOCK requests together. ACOPY method invocation MUST NOT duplicate any write locks active on the source. However, as previously noted, if the COPY copieslock request to an unmapped URL SHOULD result in theresource into a collection that iscreation of an lockedwith "Depth: infinity", then theresourcewill be added to the lock.with empty content. Asuccessful MOVEsubsequent PUT requeston a write locked resource MUST NOT move the write lockwith theresource. However, the resource is subject to being added to an existingcorrect lockat the destination (see Section 7.5). For example, if the MOVE makestoken SHOULD normally succeed, and this new request provides theresource a child ofcontent, content-type, content-language and other information as appropriate. In this situation, acollection that is locked with "Depth: infinity", then the resource will be added toWebDAV server thatcollection's lock. Additionally, ifwas implemented from RFC2518 MAY create "lock-null" resources which are special and unusual resources. Historically, aresource lockedlock-null resource: o Responds with"Depth: infinity" is moveda 404 or 405 to any DAV method except for PUT, MKCOL, OPTIONS, PROPFIND, LOCK, UNLOCK. o Appears as adestination that is within the scopemember ofthe sameits parent collection. o Disappears (URI becomes unmapped) if its lock(e.g., within the namespace tree covered by the lock), the moved resource will again be a addedgoes away before it is converted tothe lock. In both these examples, as specified in Section 7.6, an If header must be submitted containingalock token for both the source and destination. 7.8 Refreshing Write Locks A client MUST NOT submit the same write lock request twice. Noteregular resource. (This must also happen if it is renamed or moved, or if any parent collection is renamed or Dusseault & Crawford Expires January15, 200516, 2006 [Page22]23] Internet-Draft RFC2518bis July2004 that a client is always aware it is resubmitting the same lock request2005 moved, becauseit must include the lock token in the If header in orderlocks are tied tomake the request forURLs). o May be turned into a regular resourcethat is already locked. However, a client may submit a LOCK method with an If header but withoutwhen abody. This form of LOCK MUST only be usedPUT request to"refresh" a lock. Meaning, at minimum, that any timers associated withthelock MUSTURL is successful. Ceases to bere-set. A server may returnaTimeout header withlock-null resource. o May be turned into alock refresh that is different than the Timeout header returnedcollection when a MKCOL request to thelock was originally requested. Additionally clients may submit Timeout headers of arbitrary value with their lock refresh requests. Servers, as always, may ignore Timeout headers submitted by the client. Note that timeoutURL ismeasured in seconds remaining until expiration. If an error is received in responsesuccessful. Ceases to be arefresh LOCK request the client MUST NOT assume that the lock was refreshed. Dusseault & Crawford Expires January 15, 2005 [Page 23] Internet-Draft RFC2518bis July 2004 8. HTTP Methodslock-null resource. o Has defined values forDistributed Authoring 8.1 General request and response handling 8.1.1 Use of XML Some of the following new HTTP methods use XML as a requestlockdiscovery andresponse format. All DAV compliant clientssupportedlock properties. However, interoperability andresources MUST use XML parsers that are compliantcompliance problems have been found withXML [11]lock-null resources. Therefore, they are deprecated. WebDAV servers SHOULD create regular locked empty resources, which are andXML Namespaces [10]. All XML usedbehave ineither requests or responses MUST be, at minimum, well formedevery way as normal resources. A locked empty resource: o Can be read, deleted, moved, copied, anduse namespaces correctly. If a server receives non- wellformed XMLin all ways behave as arequest it MUST reject the entire request with a 400 (Bad Request). Ifregular resource, not aclient receives ill-formed XML inlock-null resource. o Appears as aresponse then it MUST NOT assume anything about the outcomemember ofthe executed method andits parent collection. o SHOULDtreat the server as malfunctioning. 8.1.2 Required Bodies in Requests Some of these new methods do not define bodies. Servers MUST examine all requests for a body, evenNOT disappear whena body was not expected. In cases where a request body is present but would be ignored by a server, the server MUST reject the requestits lock goes away (clients must therefore be responsible for cleaning up their own mess, as with415 (Unsupported Media Type). This informs the client (which mayany other operation) o SHOULD default to having no content type. o MAY NOT have values for properties like getcontentlanguage which haven't beenattempting to use an extension) thatspecified yet by thebody could notclient. o May have content added with a PUT request. MUST beprocessedable to change content type. o MUST NOT be turned into a collection. A MKCOL request must fail asthey intended. 8.1.3 Useit would to any existing resource. o MUST have defined values for lockdiscovery and supportedlock properties. o The response MUST indicate that a resource was created, by use ofLocation header in responses WhentheLocation header is used"201 Created" response code (a LOCK request to an existing resource instead will result in 200 OK). The body must still include the lockdiscovery property, as with aresponse, itLOCK request to an existing resource. The client isused by the serverexpected toindicateupdate thepreferred address forlocked empty resource shortly after locking it, using PUT and possibly PROPPATCH. When thetargetclient uses PUT to overwrite a locked empty resourceoftherequest. Wheneverclient MUST supply a Content-Type if any is known. If theserver hasclient supplies apreferred address, it should useContent- Dusseault & Crawford Expires January 16, 2006 [Page 24] Internet-Draft RFC2518bis July 2005 Type value the server MUST set thataddress consistently. This meansvalue (this requirement actually applies to any resource thatwhenis overwritten but is particularly necessary for locked empty resources which are initially created with no Content-Type. Clients can easily interoperate both with servers that support the deprecated lock-null resources and servers that support simpler locked empty resources by only attempting PUT after aresponse containsLOCK to an unmapped URL, not MKCOL or GET. 7.7 Write Locks and Collections A write lock on aLocation header, allcollection, whether created by a "Depth: 0" or "Depth: infinity" lock request, prevents the addition or removal of member URLsinof theresponse body (e.g.collection by non-lock owners. A zero-depth lock on aMulti-Status) should be consistent (most importantly, should use the same host and port). 8.1.4 Required Response Headers: Date Note that HTTP 1.1 requires the Date header in all responses if possible. 8.1.5 ETag HTTP 1.1 recommendscollection affects changes to theusedirect membership ofthe ETag header in responsesthat collection. When a principal issues a write request toGET and PUT requests. Correct use of ETags is even more importantcreate a new resource in adistributed authoring environment, because ETags are necessary along with locks to avoidwrite locked collection, or isses a DELETE, MOVE or other request that would remove an existing internal member URL of a write locked collection or change thelost-update problem. A client mightbinding name, this request MUST failto renew a lock, for example whenif the principal does not provide the correct locktimes out andtoken for theclientlocked collection. This means that if a collection isaccidentally offlinelocked (depth 0 or infinity), its lock-token is required inthe middleall these cases: o DELETE a collection's direct internal member o MOVE a member out of the collection o MOVE along upload. Whenmember into the collection, unless it overwrites a pre- existing member o MOVE to rename it within a collection, o COPY a member into a collection, unless it overwrites a pre- existing member o PUT or MKCOL request which would create a new member. The collection's lock token is required in addition to the lock token on the internal member itself, if it is locked separately. In addition, a depth-infinity lock affects all write operations to all descendents of the locked collection. With a depth-infinity lock, the root of the lock is directly locked, and all its descendants are indirectly locked. Dusseault & Crawford Expires January15, 200516, 2006 [Page24]25] Internet-Draft RFC2518bis July2004 client fails to renew the lock, it's quite possible the2005 o Any new resourcecan still be relocked and the user can go on editing, as longadded asno changes were made in the meantime. ETags are required for the client to be able to distinguish this case. Otherwise,a descendent of a depth-infinity locked collection becomes indirectly locked. o Any indirectly locked resource moved out of theclientlocked collection into an unlocked collection isforced to askthereafter unlocked. o Any indirectly locked resource moved out of a locked source collection into a depth-infinity locked target collection remains indirectly locked but is now within theuser whether to overwritescope of theresourcelock on theserver without even being abletarget collection (the target collection's lock token will thereafter be required totell the user whether it has changed. Timestamps do not solve this problem nearly as well as ETags. WebDAV servers SHOULD support strong ETags for allmake further changes). If a depth-infinity write LOCK request is issued to a collection containing member URLs identifying resources thatmay be PUT. If ETagsaresupported forcurrently locked in aresource,manner which conflicts with theserver MUST returnwrite lock, theETag header in all PUTrequest MUST fail with a 423 (Locked) status code, andGET responses to that resource, as well as provide the same value forthe'getetag' property. Because clients may be forced to prompt users or throw away changed content ifresponse SHOULD contain theETag changes,'missing-lock-token' precondition. If aWebDAV server MUST not changelock owner causes theETag (or getlastmodified value) forURL of a resourcethat hasto be added as anunchanged body. The ETag represents the state of the body or contentsinternal member URL of a depth-infinity locked collection then theresource. There is no similar waynew resource MUST be automatically added totell if properties have changed. 8.1.6 Including error response bodies HTTP and WebDAV did not usethebodies of most error responses for machine-parsable information until DeltaV introduced a mechanism to include more specific information inlock. This is thebody of an error response (section 1.6 of RFC3253 [18]). Theonly mechanismis appropriate to use with any error responsethatmay takeallows abody but does not already haveresource to be added to abody defined. The mechanismwrite lock. Thus, for example, if the collection /a/b/ isparticularly appropriate when a status code can mean many things (for example, 400 Badwrite locked and the resource /c is moved to /a/b/c then resource /a/b/c will be added to the write lock. 7.8 Write Locks and the If Requestcan mean required headers are missing, headers are incorrectly formatted, or much more). This mechanism doesHeader If a user agent is nottakerequired to have knowledge about a lock when requesting an operation on a locked resource, theplace of usingfollowing scenario might occur. Program A, run by User A, takes out acorrect numeric error code as defined here or in HTTP, becausewrite lock on a resource. Program B, also run by User A, has no knowledge of theclient MUST always be ablelock taken out by Program A, yet performs a PUT totakethe locked resource. In this scenario, the PUT succeeds because locks are associated with areasonable course of action based only onprincipal, not a program, and thus program B, because it is acting with principal Ais credential, is allowed to perform thenumeric error.PUT. However, had program B known about the lock, itdoes removewould not have overwritten theneedresource, preferring instead todefine new numeric error codes, avoidingpresent a dialog box describing theconfusion of who is allowedconflict to the user. Due todefine such new codes. The codes used inthismechanism are XML elements in a namespace, so naturally any group definingscenario, anew error code can use their own namespace. As always, the "DAV:" namespacemechanism isreserved for use by IETF-chartered WebDAV working groups. A server supporting "bis" SHOULD include a specific XML error code inneeded to prevent different programs from accidentally ignoring locks taken out by other programs with the same authorization. In order to prevent these collisions a"DAV:error" response body element, whenlock token MUST be submitted by an authorized principal for all locked resources that aspecific XML error code is defined in this document. The ȼDAV:errorȫ elementmethod maycontain multiple elements describing specific errors. For error conditions not specified in this document,change or theserver MAY simply choosemethod MUST fail. A lock token is submitted when it appears in anappropriate numeric statusIf header. For example, if a resource is to be moved andleaveboth theresponse body blank.source and destination are locked then two lock tokens Dusseault & Crawford Expires January15, 200516, 2006 [Page25]26] Internet-Draft RFC2518bis July20042005 must be submitted in the if header, one for the source and the other for the destination. Example - Write Lock >>Request COPY /~fielding/index.html HTTP/1.1403 Forbidden Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:error xmlns:D="DAV:"> <D:forbid-external-entities/> </D:error>Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html If: <http://www.ics.uci.edu/users/f/fielding/index.html> (<opaquelocktoken:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>) >>Response HTTP/1.1 204 No Content In thisspecification,example, even though both thenumericsource andthe XML error codedestination aredefined for some failure situations, in which case the XML error codelocked, only one lock token musthave the "DAV:" namespace, appear in the "error" root element, andbereturned in a body withsubmitted, for thenumeric error code specified. 8.2 PROPFIND The PROPFIND method retrieves properties definedlock on theresource identified by the Request-URI, ifdestination. This is because the source resourcedoesis nothave any internal members, or on the resource identifiedmodified by a COPY, and hence unaffected by theRequest-URIwrite lock. In this example, user agent authentication has previously occurred via a mechanism outside the scope of the HTTP protocol, in the underlying transport layer. 7.9 Write Locks andpotentially its member resources,COPY/MOVE A COPY method invocation MUST NOT duplicate any write locks active on the source. However, as previously noted, if the COPY copies the resourceisinto a collection thathas internal member URLs. All DAV compliant resources MUST supportis locked with "Depth: infinity", then thePROPFIND method andresource will be added to thepropfind XML element (Section 13.25) along with all XML elements defined for use with that element.lock. Aclient may submitsuccessful MOVE request on aDepth headerwrite locked resource MUST NOT move the write lock with the resource. However, the resource is subject to being added to an existing lock at the destination (see Section 7.7). For example, if the MOVE makes the resource avaluechild of"0", "1", or "infinity" with a PROPFIND ona collectionresource. Servers MUST support the "0", "1" and "infinity" behaviors on WebDAV-compliant resources. By default,that is locked with "Depth: infinity", then thePROPFIND method without a Depth header MUST act asresource will be added to that collection's lock. Additionally, if a resource locked with "Depth: infinity"header was included. A client may submitis moved to apropfind XML element indestination that is within thebodyscope of therequest method describing what information is being requested. It is possible to request: o Request particular property values, by naming the properties desiredsame lock (e.g., within the'prop' element (the ordering of properties in here MAY be ignored by server) o Request all dead property values, by using 'dead-props' element. This can be combined with retrieving specific live properties named as above. Servers advertising support for RFC2518bis MUST support this feature. o Request property values for those properties defined in this specification plus dead properties,namespace tree covered byusing 'allprop' element o Request a list of names of all the properties defined ontheresource, by usinglock), the'propname' element. A client may choose not to submit a request body. An empty PROPFIND request body MUSTmoved resource will again betreateda added to the lock. In both these examples, asif it werespecified in Section 7.8, an'allprop' request.If header must be submitted containing a lock token for both the source and destination. Dusseault & Crawford Expires January15, 200516, 2006 [Page26]27] Internet-Draft RFC2518bis July20042005 7.10 Refreshing Write Locks A client MUST NOT submit the same write lock request twice. Note that'allprop' does not return values for all live properties. WebDAV servers increasingly have expensively-calculated or lengthy properties (see RFC3253 [18] and RFC3744 [19]) and do not return all properties already. Instead, WebDAV clients can use propname requests to discover what live properties exist, anda client is always aware it is resubmitting the same lock requestnamed properties when retrieving values. A WebDAV server MAY omit certain live properties from other specifications when respondingbecause it must include the lock token in the If header in order toan allpropmake the requestfrom an older client, and MAY return only custom (dead) properties and those defined in this specification. All servers MUST support returningfor aresponse of content type text/ xml or application/xmlresource thatcontainsis already locked. However, amultistatus XML element that describes the resultsclient may submit a LOCK method with an If header but without a body. This form ofthe attemptsLOCK MUST only be used toretrieve"refresh" a lock. Meaning, at minimum, that any timers associated with thevarious properties. The multistatus contains one response element for each resource inlock MUST be re-set. A server may return a Timeout header with a lock refresh that is different than thescope ofTimeout header returned when therequest (in no required order) orlock was originally requested. Additionally clients maybe empty if no resources matchsubmit Timeout headers of arbitrary value with their lock refresh requests. Servers, as always, may ignore Timeout headers submitted by therequest. If thereclient. Note that timeout is measured in seconds remaining until expiration. If an errorretrieving a property thenis received in response to aproper error resultrefresh LOCK request the client MUSTbe included inNOT assume that theresponse. Alock was refreshed. Dusseault & Crawford Expires January 16, 2006 [Page 28] Internet-Draft RFC2518bis July 2005 8. HTTP Methods for Distributed Authoring 8.1 General requestto retrieve the valueand response handling 8.1.1 Use of XML Some of the following new HTTP methods use XML as aproperty which does not exist is an errorrequest andMUST be noted, if theresponseuses a multistatusformat. All DAV compliant clients and resources MUST use XMLelement,parsers that are compliant witha responseXMLelement which contains[11] and XML Namespaces [10]. All XML used in either requests or responses MUST be, at minimum, well formed and use namespaces correctly. If a404 (Not Found) status value. Consequently, the multistatusserver receives non- wellformed XMLelement forin acollection resource with member URLsrequest it MUSTincludereject the entire request with aresponse400 (Bad Request). If a client receives ill-formed XMLelement for each member URL of the collection, to whatever depth was requested. Eachin a responseXML elementthen it MUSTcontain an href XML element that givesNOT assume anything about theURLoutcome of theresource on which the properties inexecuted method and SHOULD treat theprop XML element are defined. URLs for collections appearingserver as malfunctioning. 8.1.2 Required Bodies inthe resultsRequests Some of these new methods do not define bodies. Servers MUSTend in a slash character. Resultsexamine all requests for aPROPFIND on a collection resource with internal member URLs are returned asbody, even when aflat list whose order of entries isbody was notsignificant. A server enumerating the members ofexpected. In cases where acollection using absolute URLs inrequest body is present but would be ignored by aPROPFIND responseserver, the server MUST reject the request with 415 (Unsupported Media Type). This informs the client (which may have been attempting to usea common prefix in those URLs, andan extension) thatprefix MUSTthe body could not be processed as they intended. 8.1.3 Use of Location header in responses When theabsolute URLLocation header is used in a response, it is used by theresponseserver torefer to the parent collection. Unless otherwise notified, clients may expect thatindicate theURLpreferred address for theparent collectiontarget resource of the request. Whenever the server has a preferred address, it should use that address consistently. This means that when a response contains a Location header, all the URLs in thePROPFINDresponsewillbody (e.g. a Multi-Status) should be consistent (most importantly, should use the sameURLhost and port). 8.1.4 Required Response Headers: Date Note thatwas used to refer toHTTP 1.1 requires theparent collectionDate header in all responses if possible. 8.1.5 ETag HTTP 1.1 recommends thePROPFIND request. Servers MAYusean alternate URL forof theparent collectionETag header ina PROPFIND response, butresponses to GET and PUT requests. Correct use of ETags is even more important inthis case the server MUST includeaContent-Location header whose value is the fully-qualified URL used by the serverdistributed authoring environment, because ETags are necessary along with locks toreferavoid the lost-update problem. A client might fail to renew a lock, for example when theparent collectionlock times out and the client is accidentally offline or inthis response. Clients expectthefully-qualified URLs of membersmiddle of acollection to havelong upload. When acommon prefix which is the fully-qualified URL of the parentDusseault & Crawford Expires January15, 200516, 2006 [Page27]29] Internet-Draft RFC2518bis July2004 collection itself. URLs in a PROPFIND response body MAY2005 client fails to renew the lock, it's quite possible the resource can still berepresentedrelocked and the user can go on editing, asfully- qualified URLs,long as no changes were made inwhich case they must all containthefull parent collection URL (scheme, host, port, and absolute path). Alternatively, these URLs MAYmeantime. ETags are required for the client to beabsolute paths (not containing scheme, host or port), but inable to distinguish thiscase they must all still containcase. Otherwise, thefull parent collection path. If a server allows resource namesclient is forced toinclude characters that arenȡt legal in HTTP URL paths, these characters must be URI-escapedask the user whether to overwrite the resource on thewire. For example, it is illegalserver without even being able touse a space character or double- quote in a URI [6]. URIs appearing in PROPFIND or PROPPATCH XML bodies (or other XML marshalling defined intell the user whether it has changed. Timestamps do not solve thisspecification) are still subject toproblem nearly as well as ETags. WebDAV servers SHOULD support strong ETags for allURI rules, including forbidden characters. Propertiesresources that may besubject to access control. InPUT. If ETags are supported for a resource, thecase of allpropserver MUST return the ETag header in all PUT andpropname,GET responses to that resource, as well as provide the same value for the 'getetag' property. Because clients may be forced to prompt users or throw away changed content if the ETag changes, aprincipal doesWebDAV server MUST nothavechange theright to know whetherETag (or getlastmodified value) for aparticular property exists thenresource that has an unchanged body. The ETag represents theproperty MAY be silently excluded fromstate of theresponse. The resultsbody or contents ofthis method SHOULD NOT be cached. 8.2.1 Example - Retrieving Named Properties >>Request PROPFIND /file HTTP/1.1 Host: www.example.com Content-type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:"> <D:prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <R:author/> <R:DingALing/> <R:Random/> </D:prop> </D:propfind> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Dusseault & Crawford Expires January 15, 2005 [Page 28] Internet-Draft RFC2518bis July 2004 <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:"> <D:response xmlns:R="http://www.example.com/boxschema/"> <D:href>http://www.example.com/file</D:href> <D:propstat> <D:prop> <R:bigbox> <R:BoxType>Box type A</R:BoxType> </R:bigbox> <R:author> <R:Name>J.J. Johnson</R:Name> </R:author> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> <D:propstat> <D:prop><R:DingALing/><R:Random/></D:prop> <D:status>HTTP/1.1 403 Forbidden</D:status> <D:responsedescription> The user does not have access totheDingALing property. </D:responsedescription> </D:propstat> </D:response> <D:responsedescription>resource. Therehas been an access violation error. </D:responsedescription> </D:multistatus> In this example, PROPFINDisexecuted on a non-collection resource http://www.example.com/file. The propfind XML element specifies the name of four properties whose values are being requested. In this case only twono similar way to tell if propertieswere returned, since the principal issuing the requesthave changed. 8.1.6 Including error response bodies HTTP and WebDAV did nothave sufficient access rights to seeuse thethird and fourth properties. Dusseault & Crawford Expires January 15, 2005 [Page 29] Internet-Draft RFC2518bis July 2004 8.2.2 Example - Retrieving Named and Dead Properties >>Request PROPFIND /mycol/ HTTP/1.1 Host: www.example.com Depth: 1 Content-type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:"> <D:prop> <D:creationdate/> <D:getlastmodified/> </D:prop> <D:dead-props/> </D:propfind> In this example, PROPFIND is executed onbodies of most error responses for machine-parsable information until DeltaV introduced acollection resource http:/ /www.example.com/mycol/. The client requestsmechanism to include more specific information in thevaluesbody oftwo specific live properties plus all dead properties (names and values).an error response (section 1.6 of RFC3253 [14]). The mechanism is appropriate to use with any error response that may take a body but does not already have a body defined. The mechanism is particularly appropriate when a status code can mean many things (for example, 400 Bad Request can mean required headers are missing, headers are incorrectly formatted, or much more). This mechanism does notshown. 8.2.3 Example - Using propnametake the place of using a correct numeric error code as defined here or in HTTP, because the client MUST always be able toRetrieve all Property Names >>Request PROPFIND /container/take a reasonable course of action based only on the numeric error. However, it does remove the need to define new numeric error codes, avoiding the confusion of who is allowed to define such new codes. The codes used in this mechanism are XML elements in a namespace, so naturally any group defining a new error code can use their own namespace. As always, the "DAV:" namespace is reserved for use by IETF-chartered WebDAV working groups. A server supporting "bis" SHOULD include a specific XML error code in a "DAV:error" response body element, when a specific XML error code is defined in this document. The DAV:error element may contain multiple elements describing specific errors. For error conditions not specified in this document, the server MAY simply choose an appropriate numeric status and leave the response body blank. Dusseault & Crawford Expires January 16, 2006 [Page 30] Internet-Draft RFC2518bis July 2005 HTTP/1.1Host: www.example.com403 Forbidden Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?><propfind xmlns="DAV:"> <propname/> </propfind> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <multistatus xmlns="DAV:"> <response> <href>http://www.example.com/container/</href> <propstat> Dusseault & Crawford Expires January 15, 2005 [Page 30] Internet-Draft RFC2518bis July 2004 <prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <R:author/> <creationdate/> <displayname/> <resourcetype/> <supportedlock/> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> <response> <href>http://www.example.com/container/front.html</href> <propstat> <prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <creationdate/> <displayname/> <getcontentlength/> <getcontenttype/> <getetag/> <getlastmodified/> <resourcetype/> <supportedlock/> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> </multistatus><D:error xmlns:D="DAV:"> <D:forbid-external-entities/> </D:error> In thisexample, PROPFIND is invoked onspecification, both thecollection resource http://www.example.com/container/, with a propfind XML element containingnumeric and thepropnameXMLelement, meaning the name of all properties should be returned. Since no Depth header is present, it assumes its default value of "infinity", meaningerror code are defined for some failure situations, in which case thename ofXML error code must have theproperties on"DAV:" namespace, appear in thecollection"error" root element, andall its descendents shouldbereturned. Consistentreturned in a body with theprevious example, resource http:// www.example.com/container/ has sixnumeric error code specified. 8.2 PROPFIND The PROPFIND method retrieves properties defined onit: bigbox and author inthe"http://www.example.com/boxschema/" namespace, and creationdate, displayname, resourcetype, and supportedlock inresource identified by the Request-URI, if the"DAV:" namespace. Theresourcehttp://www.example.com/container/index.html, adoes not have any internal members, or on the resource identified by the Request-URI and potentially its memberofresources, if the"container" collection,resource is a collection that hasnine properties defined on it, bigbox ininternal member URLs. All DAV compliant resources MUST support the"http://www.example.com/boxschema/" namespace and, creationdate, displayname, getcontentlength, getcontenttype, getetag, Dusseault & Crawford Expires January 15, 2005 [Page 31] Internet-Draft RFC2518bis July 2004 getlastmodified, resourcetype,PROPFIND method andsupportedlock inthe"DAV:" namespace. This example also demonstrates the use ofpropfind XMLnamespace scoping and the default namespace. Since the "xmlns" attribute does not contain a prefix, the namespace applies by default to all enclosed elements. Hence,element (Section 13.25) along with all XML elementswhich do not explicitly state the namespace to which they belong are members of the "DAV:" namespace schema. 8.2.4 PROPFIND Request Errors PROPFIND requests may also fail entirely, before the server even gets a chance to evaluate individual properties. 404 (Not Found) and 401 (Unauthorized) are possible asdefined for use withevery request. These are some other notable errors. 403 Forbidden -that element. Aserver MAY reject all PROPFIND requests on collections with depthclient may submit a Depth header with a value of"Infinity", in which case it SHOULD use this error"0", "1", or "infinity" withthe element 'propfind-infinite-depth-forbidden' inside the body. 8.3 PROPPATCH The PROPPATCH method processes instructions specified in the request body to set and/or remove properties defineda PROPFIND onthe resource identified by the Request-URI. All DAV compliant resourcesa collection resource. Servers MUST support thePROPPATCH method"0", "1" andMUST process instructions that are specified using"infinity" behaviors on WebDAV-compliant resources. By default, thepropertyupdate, set, and removePROPFIND method without a Depth header MUST act as if a "Depth: infinity" header was included. A client may submit a propfind XMLelements. Execution of the directiveselement inthis method is, of course, subject to access control constraints. DAV compliant resources SHOULD supportthesetting of arbitrary dead properties. The request messagebody ofa PROPPATCH method MUST containthepropertyupdate XML element. Instruction processing MUST occur in document order (an exception torequest method describing what information is being requested. It is possible to: o Request particular property values, by naming thenormal rule thatproperties desired within the 'prop' element (the orderingis irrelevant). Instructions MUST either allof properties in here MAY beexecuted or none executed. Thus if any error occurs during processingignored by server) o Request allexecuted instructions MUST be undone and a proper error result returned. Instruction processing detailsdead property values, by using 'dead-props' element. This can befound in the definition of the set and remove instructions in sections 13.23 and section 13.24. 8.3.1 Status Codes for usecombined with207 (Multi-Status) The following are examples of response codes one would expect to be used in a 207 (Multi-Status) responseretrieving specific live properties named as above. Servers advertising support for RFC2518bis MUST support thismethod. Note, however, that unless explicitly prohibited any 2/3/4/5xx seriesfeature. o Request property values for those properties defined in this specification plus dead properties, by using 'allprop' element Dusseault & Crawford Expires January15, 200516, 2006 [Page32]31] Internet-Draft RFC2518bis July2004 response code may be used in a 207 (Multi-Status) response. 200 (OK) - The command succeeded. As there can be2005 o Request amixturelist ofsets and removes in a body, a 201 (Created) seems inappropriate. 403 (Forbidden) - The client, for reasons the server chooses not to specify, cannot alter onenames of all theproperties. 403 (Forbidden): Theproperties defined on the resource, by using the 'propname' element. A clienthas attemptedmay choose not tosetsubmit aread- only property, suchrequest body. An empty PROPFIND request body MUST be treated asgetetag. If returning this error, the server SHOULDif it were an 'allprop' request. Note that 'allprop' does not return values for all live properties. WebDAV servers increasingly have expensively-calculated or lengthy properties (see RFC3253 [14] and RFC3744 [15]) and do not return all properties already. Instead, WebDAV clients can use'read-only-property' inside thepropname requests to discover what live properties exist, and request named properties when retrieving values. A WebDAV server MAY omit certain live properties from other specifications when responding to an allprop request from an older client, and MAY return only custom (dead) properties and those defined in this specification. All servers MUST support returning a responsebody. 409 (Conflict) - The client has providedof content type text/ xml or application/xml that contains avalue whose semantics are not appropriate formultistatus XML element that describes theproperty. 423 (Locked) -results of the attempts to retrieve the various properties. Thespecifiedmultistatus contains one response element for each resourceis locked andin theclient either is not a lock ownerscope of the request (in no required order) or may be empty if no resources match thelock type requiresrequest. If there is an error retrieving alock token toproperty then a proper error result MUST besubmitted and the client did not submit it. This response SHOULD containincluded in the'missing-lock-token' precondition element. 507 (Insufficient Storage) - The server did not have sufficient spaceresponse. A request torecord the property. 8.3.2 Example - PROPPATCH >>Request PROPPATCH /bar.html HTTP/1.1 Host: www.example.com Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50/"> <D:set> <D:prop> <Z:authors> <Z:Author>Jim Whitehead</Z:Author> <Z:Author>Roy Fielding</Z:Author> </Z:authors> </D:prop> </D:set> <D:remove> <D:prop><Z:Copyright-Owner/></D:prop> </D:remove> </D:propertyupdate> Dusseault & Crawford Expires January 15, 2005 [Page 33] Internet-Draft RFC2518bis July 2004 >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50"> <D:response> <D:href>http://www.example.com/bar.html</D:href> <D:propstat> <D:prop><Z:Authors/></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> <D:propstat> <D:prop><Z:Copyright-Owner/></D:prop> <D:status>HTTP/1.1 409 Conflict</D:status> </D:propstat> <D:responsedescription> Copyright Owner can not be deleted or altered.</D:responsedescription> </D:response> </D:multistatus> In this example, the client requests the server to setretrieve the value ofthe "Authors" property in the "http://www.w3.com/standards/z39.50/" namespace, and to remove the property "Copyright-Owner" in the "http://www.w3.com/standards/z39.50/" namespace. Since the Copyright-Ownera propertycouldwhich does not exist is an error and MUST beremoved, no property modifications occur. The 424 (Failed Dependency) status code for the Authors property indicates this action would have succeedednoted, ifit were not fortheconflictresponse uses a multistatus XML element, withremoving the Copyright-Owner property. 8.4 MKCOL Method The MKCOL method is used to createanew collection. All WebDAV compliant resources MUST supportresponse XML element which contains a 404 (Not Found) status value. Consequently, theMKCOL method. MKCOL createsmultistatus XML element for anewcollection resourceatwith member URLs MUST include a response XML element for each member URL of thelocation specified bycollection, to whatever depth was requested. Each response XML element MUST contain an href XML element that gives theRequest-URI. IfURL of the resourceidentified byon which theRequest-URI is non-null thenproperties in theMKCOL MUST fail. During MKCOL processing, a server MUST makeprop XML element are defined. URLs for collections appearing in theRequest-URIresults MUST end in a slash character. Results for a PROPFIND on a collection resource with internal member URLs are returned as a flat list whose order ofits parent collection, unless the Request-URIentries is"/". If no such ancestor exists, the method MUST fail. Whennot significant. A server enumerating theMKCOL operation createsmembers of anewcollectionresource, all ancestors MUST already exist, or the method MUST fail withusing absolute URLs in a409 (Conflict) status code. For example, ifPROPFIND response MUST use arequestcommon prefix in those URLs, and that prefix MUST be the absolute URL used in the response tocreaterefer to the parent collection. Unless otherwise notified, clients may expect that the URL for the parent collection/a/b/c/d/ is made, and /a/b/c/ does not exist,in therequest must fail.PROPFIND response will be the same URL that was used to refer to the parent collection in the PROPFIND request. Servers MAY use an alternate URL for the parent collection in a Dusseault & Crawford Expires January15, 200516, 2006 [Page34]32] Internet-Draft RFC2518bis July2004 When MKCOL is invoked without a request body,2005 PROPFIND response, but in this case thenewly created collection SHOULD have no members. A MKCOL request message may contain a message body. The behavior ofserver MUST include aMKCOL request when the body is presentContent-Location header whose value islimited to creating collections, members of a collection, bodies of members and properties onthecollections or members. Iffully-qualified URL used by the serverreceives a MKCOL request entity type it does not support or understand it MUST respond with a 415 (Unsupported Media Type) status code. If the server decidestoreject the request based on the presence of an entity or the type of an entity, it should userefer to the415 (Unsupported Media Type) status code. The exact behavior of MKCOL for various request media types is undefinedparent collection in thisdocument, and will be specifiedresponse. URLs inseparate documents. 8.4.1 MKCOL Status Codes Responses fromaMKCOL request MUST NOTPROPFIND response body MAY becachedrepresented asMKCOL has non- idempotent semantics. 201 (Created) - The collection was created. 403 (Forbidden) - This indicates at least one of two conditions: 1) the server does not allow the creation of collections at the given locationfully- qualified URLs, inits namespace, or 2)which case they must all contain the full parent collectionof the Request-URI exists but cannot accept members. 405 (Method Not Allowed) - MKCOL can only be executed on an unmapped URL. 409 (Conflict) - A collection cannotURL (scheme, host, port, and absolute path). Alternatively, these URLs MAY bemade at the Request-URI until oneabsolute paths (not containing scheme, host ormore intermediate collections have been created. The server MUST NOT create those intermediate collections automatically. 415 (Unsupported Media Type) - The server does not support the request type ofport), but in this case they must all still contain thebody. 507 (Insufficient Storage) - Thefull parent collection path. If a server allows resourcedoes not have sufficient spacenames torecord the state of the resource after the executioninclude characters that arenit legal in HTTP URL paths, these characters must be URI-escaped on the wire. For example, it is illegal to use a space character or double- quote in a URI [5]. URIs appearing in PROPFIND or PROPPATCH XML bodies (or other XML marshalling defined in this specification) are still subject to all URI rules, including forbidden characters. Properties may be subject to access control. In the case of allprop and propname, if a principal does not have the right to know whether a particular property exists then the property MAY be silently excluded from the response. The results of thismethod. 8.4.2method SHOULD NOT be cached. 8.2.1 Example -MKCOL This example creates a collection called /webdisc/xfiles/ on the server www.example.com.Retrieving Named Properties >>Request PROPFIND /file HTTP/1.1 Host: www.example.com Content-type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:"> <D:prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <R:author/> <R:DingALing/> <R:Random/> </D:prop> </D:propfind> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Dusseault & Crawford Expires January15, 200516, 2006 [Page35]33] Internet-Draft RFC2518bis July2004 >>Request MKCOL /webdisc/xfiles/ HTTP/1.1 Host: www.example.com >>Response HTTP/1.1 201 Created 8.5 GET, HEAD for Collections2005 Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:"> <D:response xmlns:R="http://www.example.com/boxschema/"> <D:href>http://www.example.com/file</D:href> <D:propstat> <D:prop> <R:bigbox> <R:BoxType>Box type A</R:BoxType> </R:bigbox> <R:author> <R:Name>J.J. Johnson</R:Name> </R:author> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> <D:propstat> <D:prop><R:DingALing/><R:Random/></D:prop> <D:status>HTTP/1.1 403 Forbidden</D:status> <D:responsedescription> Thesemantics of GET are unchanged when applieduser does not have access toa collection, since GET is defined as, "retrieve whatever information (intheform ofDingALing property. </D:responsedescription> </D:propstat> </D:response> <D:responsedescription> There has been anentity)access violation error. </D:responsedescription> </D:multistatus> In this example, PROPFIND isidentified by the Request-URI" [RFC2616]. GET when applied to a collection may return the contents of an "index.html" resource, a human-readable view of the contents of the collection, or something else altogether. Hence it is possible that the result of a GETexecuted on acollection will bear no correlation to the membership of the collection. Similarly, since the definition of HEAD is a GET without a response message body, the semantics of HEAD are unmodified when applied to collection resources. 8.6 POST for Collections Since by definition the actual function performed by POST is determined by the server and often depends on the particular resource, the behavior of POST when applied to collections cannot be meaningfully modified because it is largely undefined. Thusnon-collection resource http://www.example.com/file. The propfind XML element specifies thesemanticsname ofPOSTfour properties whose values areunmodified when applied to a collection. 8.7 DELETE 8.7.1 DELETE for Non-Collection Resources When a client issues a DELETE request to a Request-URI mapping to a non-collection resource, if the operation is successfulbeing requested. In this case only two properties were returned, since theserver MUST remove that mapping. Thus, after a successful DELETE operation (and inprincipal issuing theabsence of other actions) a subsequent GET/HEAD/PROPFINDrequest did not have sufficient access rights to see thetarget Request-URI MUST return 404 (Not Found). 8.7.2 DELETE for Collections The DELETE method on a collection MUST act as if a "Depth: infinity" header was used on it. A client MUST NOT submit a Depth header withthird and fourth properties. Dusseault & Crawford Expires January15, 200516, 2006 [Page36]34] Internet-Draft RFC2518bis July2004 a DELETE2005 8.2.2 Example - Retrieving Named and Dead Properties >>Request PROPFIND /mycol/ HTTP/1.1 Host: www.example.com Depth: 1 Content-type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:"> <D:prop> <D:creationdate/> <D:getlastmodified/> </D:prop> <D:dead-props/> </D:propfind> In this example, PROPFIND is executed on a collectionwith any value but infinity. DELETE instructs that the collection specified inresource http://www.example.com/mycol/. The client requests theRequest-URI andvalues of two specific live properties plus allresources identified by its internal member URLs aredead properties (names and values). The response is not shown. 8.2.3 Example - Using propname tobe deleted. If anyRetrieve all Property Names >>Request PROPFIND /container/ HTTP/1.1 Host: www.example.com Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <propfind xmlns="DAV:"> <propname/> </propfind> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <multistatus xmlns="DAV:"> <response> <href>http://www.example.com/container/</href> <propstat> Dusseault & Crawford Expires January 16, 2006 [Page 35] Internet-Draft RFC2518bis July 2005 <prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <R:author/> <creationdate/> <displayname/> <resourcetype/> <supportedlock/> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> <response> <href>http://www.example.com/container/front.html</href> <propstat> <prop xmlns:R="http://www.example.com/boxschema/"> <R:bigbox/> <creationdate/> <displayname/> <getcontentlength/> <getcontenttype/> <getetag/> <getlastmodified/> <resourcetype/> <supportedlock/> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> </multistatus> In this example, PROPFIND is invoked on the collection resourceidentified byhttp://www.example.com/container/, with amember URL cannot be deleted thenpropfind XML element containing the propname XML element, meaning the name of all properties should be returned. Since no Depth header is present, it assumes its default value of "infinity", meaning themember's ancestors MUST NOTname of the properties on the collection and all its descendents should bedeleted, so as to maintain namespace consistency. Any headers includedreturned. Consistent withDELETE MUST be applied in processing every resource to be deleted. WhentheDELETE methodprevious example, resource http://www.example.com/container/ hascompleted processing it MUST resultsix properties defined on it: bigbox and author ina consistent namespace. If an error occurs deleting an internal resource (a resource other thantheresource identified"http://www.example.com/boxschema/" namespace, and creationdate, displayname, resourcetype, and supportedlock in theRequest-URI) then the response can be a 207 (Multi-Status). Multi-Status is used here to indicate which internal resources could NOT be deleted, including an error code which should help the client understand which resources caused the failure. For example, the Multi-Status body could include a response with status 423 (Locked) if an internal resource was locked."DAV:" namespace. Theserver MAY return a 4xx status response, rather thanresource http://www.example.com/container/index.html, aMulti- Status, if the entire DELETE request failed and it canȡt identify the internal resources that caused the DELETE to fail. 424 (Failed Dependency) errors SHOULD NOT be in the 207 (Multi- Status). They can be safely left out because the client will know that the ancestorsmember ofa resource could not be deleted when the client receives an error fortheancestor's progeny. Additionally 204 (No Content) errors SHOULD NOT be returned"container" collection, has nine properties defined on it, bigbox in the207 (Multi- Status). The reason for this prohibition is that 204 (No Content) is the default success code."http://www.example.com/boxschema/" namespace and, creationdate, displayname, getcontentlength, getcontenttype, getetag, Dusseault & Crawford Expires January15, 200516, 2006 [Page37]36] Internet-Draft RFC2518bis July2004 8.7.3 Example - DELETE >>Request DELETE /container/ HTTP/1.1 Host: www.example.com >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d="DAV:"> <d:response> <d:href>http://www.example.com/container/resource3</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> In this example the attempt to delete http://www.example.com/ container/resource3 failed because it is locked,2005 getlastmodified, resourcetype, andno lock token was submitted with the request. Consequently,supportedlock in theattempt to delete http://www.example.com/container/"DAV:" namespace. This example alsofailed. Thusdemonstrates theclient knows thatuse of XML namespace scoping and theattempt to delete http://www.example.com/container/ must have also failed sincedefault namespace. Since theparent can"xmlns" attribute does notbe deleted unless its child has also been deleted. Even thoughcontain aDepth header hasprefix, the namespace applies by default to all enclosed elements. Hence, all elements which do notbeen included, a depthexplicitly state the namespace to which they belong are members ofinfinity is assumed becausethemethod is on"DAV:" namespace schema. 8.2.4 PROPFIND Request Errors PROPFIND requests may also fail entirely, before the server even gets acollection. 8.8 PUT 8.8.1 PUT for Non-Collection Resourceschance to evaluate individual properties. 404 (Not Found) and 401 (Unauthorized) are possible as with every request. These are some other notable errors. 403 Forbidden - APUT performedserver MAY reject all PROPFIND requests onan existing resource replaces the GET response entitycollections with depth header of "Infinity", in which case it SHOULD use this error with theresource. Propertieselement 'propfind-infinite-depth-forbidden' inside the body. 8.3 PROPPATCH The PROPPATCH method processes instructions specified in the request body to set and/or remove properties defined on the resourcemay be recomputed during PUT processing but are not otherwise affected. For example, if a server recognizes the content type ofidentified by therequest body, it may be able to automatically extract informationRequest-URI. All DAV compliant resources MUST support the PROPPATCH method and MUST process instructions thatcould be profitably exposed asare specified using the propertyupdate, set, and remove XML elements. Execution of the directives in this method is, of course, subject to access control constraints. DAV compliant resources SHOULD support the setting of arbitrary dead properties.A PUTThe request message body of a PROPPATCH method MUST contain the propertyupdate XML element. Instruction processing MUST occur in document order (an exception to the normal rule thatwouldordering is irrelevant). Instructions MUST either all be executed or none executed. Thus if any error occurs during processing all executed instructions MUST be undone and a proper error result returned. Instruction processing details can be found in thecreationdefinition ofa resource without an appropriately scoped parent collection MUST failthe set and remove instructions in sections 13.23 and section 13.24. 8.3.1 Status Codes for use with 207 (Multi-Status) The following are examples of response codes one would expect to be used in a409 (Conflict).207 (Multi-Status) response for this method. Note, however, that unless explicitly prohibited any 2/3/4/5xx series Dusseault & Crawford Expires January15, 200516, 2006 [Page38]37] Internet-Draft RFC2518bis July2004 8.8.2 PUT for Collections As defined2005 response code may be used inRFC2616 [8], the "PUT method requests that the enclosed entitya 207 (Multi-Status) response. 200 (OK) - The command succeeded. As there can bestored under the supplied Request-URI." Since submission of an entity representingacollection would implicitly encode creation and deletionmixture ofresources, this specification intentionally does not define a transmission format for creatingsets and removes in acollection using PUT. Instead, the MKCOL method is defined to create collections. 8.9 COPY The COPY method createsbody, aduplicate of the source resource, identified by the Request-URI, in the destination resource, identified by the URI in the Destination header. The Destination header MUST be present.201 (Created) seems inappropriate. 403 (Forbidden) - Theexact behavior of the COPY method depends on the type of the source resource. All WebDAV compliant resources MUST support the COPY method. However, supportclient, for reasons theCOPY method doesserver chooses notguaranteeto specify, cannot alter one of theabilityproperties. 403 (Forbidden): The client has attempted tocopyset aresource. For example, separate programs may control resources onread- only property, such as getetag. If returning this error, thesame server. Asserver SHOULD use 'read-only-property' inside the response body. 409 (Conflict) - The client has provided aresult, it mayvalue whose semantics are notbe possible to copy a resource to a location that appears to be on the same server. 8.9.1 COPYappropriate forNon-collection Resources Whenthesourceproperty. 423 (Locked) - The specified resource isnot a collection the result oflocked and theCOPY methodclient either isthe creation ofnot anew resource at the destination whose state and behavior match that of the source resource as closely as possible. Since the environment atlock owner or thedestination maylock type requires a lock token to bedifferent than atsubmitted and thesource due to factors outsideclient did not submit it. This response SHOULD contain thescope of control of the server, such as'missing-lock-token' precondition element. 507 (Insufficient Storage) - The server did not have sufficient space to record theabsence of resources required for correct operation, it mayproperty. Dusseault & Crawford Expires January 16, 2006 [Page 38] Internet-Draft RFC2518bis July 2005 8.3.2 Example - PROPPATCH >>Request PROPPATCH /bar.html HTTP/1.1 Host: www.example.com Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50/"> <D:set> <D:prop> <Z:authors> <Z:Author>Jim Whitehead</Z:Author> <Z:Author>Roy Fielding</Z:Author> </Z:authors> </D:prop> </D:set> <D:remove> <D:prop><Z:Copyright-Owner/></D:prop> </D:remove> </D:propertyupdate> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50"> <D:response> <D:href>http://www.example.com/bar.html</D:href> <D:propstat> <D:prop><Z:Authors/></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> <D:propstat> <D:prop><Z:Copyright-Owner/></D:prop> <D:status>HTTP/1.1 409 Conflict</D:status> </D:propstat> <D:responsedescription> Copyright Owner can not bepossibledeleted or altered.</D:responsedescription> </D:response> </D:multistatus> Dusseault & Crawford Expires January 16, 2006 [Page 39] Internet-Draft RFC2518bis July 2005 In this example, the client requests the server tocompletely duplicateset thebehaviorvalue of theresource at"Authors" property in thedestination. Subsequent alterations"http://www.w3.com/standards/z39.50/" namespace, and to remove thedestination resource will not modifyproperty "Copyright-Owner" in thesource resource. Subsequent alterations to"http://www.w3.com/standards/z39.50/" namespace. Since thesource resource willCopyright-Owner property could notmodify the destination resource. 8.9.2 COPY for Properties After a successful COPY invocation, all dead properties on the source resource MUSTbeduplicated onremoved, no property modifications occur. The 424 (Failed Dependency) status code for thedestination resource, along with all properties as appropriate. Live properties described inAuthors property indicates thisdocument SHOULD be duplicated as identically behaving live properties at the destination resource, butaction would have succeeded if it were notnecessarily withfor thesame values. If a property cannot be copied live, then its value MUST be duplicated, octet-for-octet, in an identically named, dead property onconflict with removing thedestination resource. Dusseault & Crawford Expires January 15, 2005 [Page 39] Internet-Draft RFC2518bis July 2004 A COPY operation creates a new resource, much like a PUT operation does. Live properties which are related to resource creation (such as creationdate) should have their values set accordingly. 8.9.3 COPY for CollectionsCopyright-Owner property. 8.4 MKCOL Method TheCOPYMKCOL methodon a collection withoutis used to create aDepth headernew collection. All WebDAV compliant resources MUSTact as if a Depth header with value "infinity" was included. A client may submit a Depth header on a COPY onsupport the MKCOL method. MKCOL creates a new collectionwith a value of "0" or "infinity". Servers MUST supportresource at the"0" and "infinity" Depth header behaviors on WebDAV-compliant resources. A COPY of depth infinity instructs thatlocation specified by the Request-URI. If thecollectionresource identified by the Request-URI isto be copied to the location identified bynon-null then theURI inMKCOL MUST fail. During MKCOL processing, a server MUST make theDestination header, and all its internal member resources are to be copied toRequest-URI alocation relative to it, recursively through all levelsmember of its parent collection, unless thecollection hierarchy. A COPY of "Depth: 0" only instructs thatRequest-URI is "/". If no such ancestor exists, thecollection and its properties but not resources identified by its internal member URLs, are to be copied. Any headers included with a COPYmethod MUSTbe applied in processing every resource to be copied with the exception of the Destination header. The Destination header only specifies the destination URI for the Request-URI.fail. Whenapplied to members ofthe MKCOL operation creates a new collectionidentified by the Request-URI the value of Destination is to be modified to reflect the current location inresource, all ancestors MUST already exist, or thehierarchy. So,method MUST fail with a 409 (Conflict) status code. For example, ifthe Request-URIa request to create collection /a/b/c/d/ is/a/ with Host header value http://example.com/made, and /a/b/c/ does not exist, theDestinationrequest must fail. When MKCOL ishttp://example.com/b/ theninvoked without a request body, the newly created collection SHOULD have no members. A MKCOL request message may contain a message body. The precise behavior of a MKCOL request whenhttp://example.com/a/c/dthe body isprocessed it must usepresent is undefined, but limited to creating collections, members of aDestinationcollection, bodies ofhttp://example.com/b/c/d. Whenmembers and properties on theCOPY method has completed processingcollections or members. If the server receives a MKCOL request entity type it does not support or understand it MUSThave createdrespond with aconsistent namespace at415 (Unsupported Media Type) status code. If thedestination (see Section 8.7.2forserver decides to reject thedefinitionrequest based on the presence ofnamespace consistency). However, ifanerror occurs while copyingentity or the type of aninternal collection,entity, it should use theserver415 (Unsupported Media Type) status code. 8.4.1 MKCOL Status Codes Responses from a MKCOL request MUST NOTcopy any resources identified by members of this collection (i.e., the server must skip this subtree),be cached asthis would create an inconsistent namespace. After detecting an error, the COPY operation SHOULD try to finish as muchMKCOL has non- idempotent semantics. 201 (Created) - The collection was created. 403 (Forbidden) - This indicates at least one ofthe original copy operation as possible (i.e.,two conditions: 1) the servershould still attempt to copy other subtrees and their members, that aredoes notdescendentsallow the creation ofan error-causing collection). So, for example, if an infinite depth copy operation is performed on collection /a/, which containscollections/a/b/ and /a/c/, and an error occurs copying /a/b/, an attempt should still be made to copy / a/c/. Similarly, after encountering an error copying a non-at the given location in its namespace, or 2) the parent collection of the Dusseault & Crawford Expires January15, 200516, 2006 [Page 40] Internet-Draft RFC2518bis July2004 collection resource as part of2005 Request-URI exists but cannot accept members. 405 (Method Not Allowed) - MKCOL can only be executed on aninfinite depth copy,unmapped URL. 409 (Conflict) - A collection cannot be made at the Request-URI until one or more intermediate collections have been created. The serverSHOULD try to finish as much of the original copy operation as possible. If an error in executingMUST NOT create those intermediate collections automatically. 415 (Unsupported Media Type) - The server does not support theCOPY method occurs with a resource other thanrequest type of the body. 507 (Insufficient Storage) - The resourceidentified in the Request-URI then the response MUST be a 207 (Multi-Status), anddoes not have sufficient space to record theURLstate of the resourcecausing the failure MUST appear withafter thespecific error. The 424 (Failed Dependency) status code SHOULD NOT be returned in the 207 (Multi-Status) response from a COPYexecution of this method.These responses can be safely omitted because the client will know that8.4.2 Example - MKCOL This example creates a collection called /webdisc/xfiles/ on theprogenyserver www.example.com. >>Request MKCOL /webdisc/xfiles/ HTTP/1.1 Host: www.example.com >>Response HTTP/1.1 201 Created 8.5 GET, HEAD for Collections The semantics ofa resource could not be copiedGET are unchanged when applied to a collection, since GET is defined as, "retrieve whatever information (in theclient receivesform of anerror for the parent. Additionally 201 (Created)/204 (No Content) status codes SHOULD NOT be returned as values in 207 (Multi-Status) responses from COPY methods. They, too, can be safely omitted because they areentity) is identified by thedefault success codes. 8.9.4 COPY andRequest-URI" [RFC2616]. GET when applied to a collection may return theOverwrite Header Ifcontents of an "index.html" resource, aresource exists athuman-readable view of thedestination andcontents of theOverwrite headercollection, or something else altogether. Hence it is"T" then prior to performing the copypossible that theserver MUST performresult of aDELETE with "Depth: infinity"GET onthe destination resource. If the Overwrite header is seta collection will bear no correlation to"F" thentheoperation will fail. 8.9.5 Status Codes 201 (Created) - The source resource was successfully copied. The copy operation resulted inmembership of thecreationcollection. Similarly, since the definition of HEAD is anew resource. 204 (No Content) - The source resource was successfully copied toGET without apre-existing destination resource. 207 (Multi-Status) - Multiple resources were to be affected by the COPY, but errors on some of them prevented the operation from taking place. Specific error messages, together with the most appropriate of the source and destination URLs, appear inresponse message body, thebodysemantics ofthe multi- status response. E.g. if a destination resource was locked and could not be overwritten, then the destination resource URL appears with the 423 (Locked) status. 403 (Forbidden) - The operation is forbidden. Possibly this is because the source and destination resourcesHEAD arethe same resource. 409 (Conflict) - A resource cannot be created at the destination until one or more intermediate collections have been created. The server MUST NOT create those intermediate collections automatically.unmodified when applied to collection resources. Dusseault & Crawford Expires January15, 200516, 2006 [Page 41] Internet-Draft RFC2518bis July2004 412 (Precondition Failed) - A precondition failed, e.g.2005 8.6 POST for Collections Since by definition theOverwrite headeractual function performed by POST is"F" anddetermined by thestate ofserver and often depends on thedestination resource is non-null. 423 (Locked) - The destinationparticular resource,or resource within the destination collection, was locked. This response SHOULD containthe'missing-lock-token' precondition element. 502 (Bad Gateway) - This may occurbehavior of POST whenthe destination is on another server, repository or namespace. Either the source namespace does not support copying to the destination namespace, or the destination namespace refusesapplied toacceptcollections cannot be meaningfully modified because it is largely undefined. Thus theresource. The client may wishsemantics of POST are unmodified when applied totry GET/PUT and PROPFIND/PROPPATCH instead. 507 (Insufficient Storage) - The destination resource does not have sufficient space to record the state of thea collection. 8.7 DELETE Locks rooted on a resourceafter the executionMUST be destroyed in a successful DELETE ofthis method. 8.9.6 COPY Examples This example shows resource http://www.ics.uci.edu/~fielding/ index.html being copiedthat resource. 8.7.1 DELETE for Non-Collection Resources When a client issues a DELETE request to a Request-URI mapping to a non-collection resource, if thelocation http://www.ics.uci.edu/users/ f/fielding/index.html. The 204 (No Content) status code indicates the existing resource at the destination was overwritten. COPY with Overwrite >>Request COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html >>Response HTTP/1.1 204 No Content The following example shows the same copyoperationbeing performed, but with the Overwrite header set to "F." A response of 412 (Precondition Failed)isreturned becausesuccessful thedestination resource hasserver MUST remove that mapping. Thus, after anon-null state. Dusseault & Crawford Expires January 15, 2005 [Page 42] Internet-Draft RFC2518bis July 2004 COPY with No Overwrite >>Request COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Overwrite: F >>Response HTTP/1.1 412 Precondition Failed Example - COPYsuccessful DELETE operation (and in the absence of other actions) aCollection >>Request COPY /container/ HTTP/1.1 Host: www.example.com Destination: http://www.example.com/othercontainer/ Depth: infinity >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d="DAV:"> <d:response> <d:href>http://www.example.com/othercontainer/R2/</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> The Depth header is unnecessary assubsequent GET/HEAD/PROPFIND request to thedefault behavior of COPYtarget Request-URI MUST return 404 (Not Found). 8.7.2 DELETE for Collections The DELETE method on a collectionis toMUST act as if a "Depth: infinity" headerhad been submitted. In this example most of the resources, along with the collection, were copied successfully. However the collection R2 failed because the destination R2 is locked. Because therewasan error copying R2, none of R2's members were copied. However no errors were listed for those members due to the error minimization rules. Dusseault & Crawford Expires January 15, 2005 [Page 43] Internet-Draft RFC2518bis July 2004 8.10 MOVE The MOVE operationused on it. A client MUST NOT submit anon-collection resource is the logical equivalent ofDepth header with acopy (COPY), followed by consistency maintenance processing, followed byDELETE on adelete ofcollection with any value but infinity. DELETE instructs that thesource, wherecollection specified in the Request-URI and allthree actionsresources identified by its internal member URLs areperformed atomically. The consistency maintenance step allows the servertoperform updates causedbe deleted. If any resource identified bythe move, such as updatinga member URL cannot be deleted then allURLs other than the Request-URI which identify the source resource, to point to the new destination resource. Consequently,of theDestination headermember's ancestors MUST NOT bepresent on all MOVE methods anddeleted, so as to maintain namespace consistency. Any headers included with DELETE MUSTfollow all COPY requirements for the COPY part ofbe applied in processing every resource to be deleted. When theMOVE method. All WebDAV compliant resourcesDELETE method has completed processing it MUSTsupportresult in a consistent namespace. If an error occurs deleting an internal resource (a resource other than theMOVE method. However, support forresource identified in theMOVE method does not guaranteeRequest-URI) then theability to moveresponse can be aresource207 (Multi-Status). Multi-Status is used here toa particular destination.indicate which internal resources could NOT be deleted, including an error code which should help the client understand which resources caused the failure. For example,separate programs may actually control different sets of resources onthesame server. Therefore, it may not be possible to moveMulti-Status body could include a response with status 423 (Locked) if an internal resourcewithinwas locked. Dusseault & Crawford Expires January 16, 2006 [Page 42] Internet-Draft RFC2518bis July 2005 The server MAY return anamespace that appears to belong to the same server. If4xx status response, rather than aresource exists at the destination,Multi- Status, if thedestination resource willrequest failed. 424 (Failed Dependency) errors SHOULD NOT bedeleted as a side-effect of the MOVE operation, subject to the restrictions of the Overwrite header. 8.10.1 MOVE for Properties Live properties describedinthis document MUSTthe 207 (Multi- Status). They can bemoved along withsafely left out because theresource, suchclient will know that the ancestors of a resourcehas identically behaving live properties at the destination resource, but not necessarily with the same values. If the live properties willcould notwork the same way at the destination, the server MUST failbe deleted when therequest (theclientcan perform COPY then DELETE if it wants a MOVE to work that badly). This can mean that the server reportsreceives an error for thelive property as "Not Found" if that'sancestor's progeny. Additionally 204 (No Content) errors SHOULD NOT be returned in themost appropriate behavior207 (Multi- Status). The reason forthat live property atthis prohibition is that 204 (No Content) is thedestination, as long asdefault success code. 8.7.3 Example - DELETE >>Request DELETE /container/ HTTP/1.1 Host: www.example.com >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d="DAV:"> <d:response> <d:href>http://www.example.com/container/resource3</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> In this example thelive propertyattempt to delete http://www.example.com/container/resource3 failed because it isstill supportedlocked, and no lock token was submitted with thesame semantics. MOVE is frequently used by clients to rename a file without changing its parent collection, so it's not appropriaterequest. Consequently, the attempt toreset live properties which are set at resource creation. For example,delete http://www.example.com/container/ also failed. Thus thecreationdate property value SHOULD remainclient knows that thesame after a MOVE. Dead propertiesattempt to delete http://www.example.com/container/ must have also failed since the parent can not bemoved along withdeleted unless its child has also been deleted. Even though a Depth header has not been included, a depth of infinity is assumed because theresource. 8.10.2 MOVEmethod is on a collection. 8.8 PUT 8.8.1 PUT forCollectionsNon-Collection Resources AMOVE with "Depth: infinity" instructs that the collection identified by the Request-URI be moved toPUT performed on an existing resource replaces theaddress specified inGET response Dusseault & Crawford Expires January15, 200516, 2006 [Page44]43] Internet-Draft RFC2518bis July2004 the Destination header, and all resources identified by its internal member URLs are to be moved to locations relative to it, recursively through all levels2005 entity of thecollection hierarchy. The MOVE methodresource. Properties defined ona collection MUST act as if a "Depth: infinity" header was used on it.the resource may be recomputed during PUT processing but are not otherwise affected. For example, if a server recognizes the content type of the request body, it may be able to automatically extract information that could be profitably exposed as properties. AclientPUT that would result in the creation of a resource without an appropriately scoped parent collection MUSTNOT submitfail with aDepth header on409 (Conflict). 8.8.2 PUT for Collections As defined in RFC2616 [7], the "PUT method requests that the enclosed entity be stored under the supplied Request-URI." Since submission of an entity representing aMOVE oncollection would implicitly encode creation and deletion of resources, this specification intentionally does not define a transmission format for creating a collectionwith any value but "infinity". Any headers included with MOVE MUSTusing PUT. Instead, the MKCOL method is defined to create collections. A PUT request to an existing collection MAY beappliedtreated as an error (405 Method Not Allowed). 8.9 COPY The COPY method creates a duplicate of the source resource identified by the Request-URI, inprocessing everythe destination resourceto be moved withidentified by theexception ofURI in the Destination header. Thebehavior of theDestination headerisMUST be present. The exact behavior of thesame as given forCOPY method depends oncollections. WhentheMOVE method has completed processing it MUST have created a consistent namespace at bothtype of the sourceand destination (see section 5.1 for the definitionresource. The state ofnamespace consistency). However, if an error occurs while moving an internal collection,the resource to be copied is fixed at the point the serverMUST NOT move any resources identified by members of the failed collection (i.e.,begins processing theserver must skipCOPY request. All WebDAV compliant resources MUST support theerror-causing subtree), as this would create an inconsistent namespace. In this case, after detectingCOPY method. However, support for theerror,COPY method does not guarantee themove operation SHOULD tryability tofinish as much ofcopy a resource. For example, separate programs may control resources on theoriginal move assame server. As a result, it may not be possible(i.e., the server should still attempttomove other subtrees and the resources identified by their members,copy a resource to a location thatare not descendents of an error-causing collection). So,appears to be on the same server. 8.9.1 COPY forexample, if an infinite depth moveNon-collection Resources When the source resource isperformed on collection /a/, which contains collections /a/b/ and /a/c/, and an error occurs moving /a/b/, an attempt should still be made to try moving /a/c/. Similarly, after encountering an error movingnot anon-collectionresource as part of an infinite depth move,theserver SHOULD try to finish as muchresult of theoriginal move operation as possible. If an error occurs withCOPY method is the creation of a new resourceother thanat the destination whose state and behavior match that of the source resourceidentified inas closely as possible. Since theRequest-URI thenenvironment at theresponse MUSTdestination may bea 207 (Multi-Status), anddifferent than at theerrored resource's URL MUST appear withsource due to factors outside thespecific error. The 424 (Failed Dependency) status code SHOULD NOT be returned in the 207 (Multi-Status) response from a MOVE method. These errors can be safely omitted becausescope of control of theclient will know thatserver, such as theprogenyabsence ofa resource could not be moved when the client receives an errorresources required forthe parent. Additionally 201 (Created)/204 (No Content) responses SHOULD NOT be returned as values in 207 (Multi-Status) responses from a MOVE. These responses cancorrect operation, it may not besafely omitted because they arepossible to completely duplicate thedefault success codes. 8.10.3 MOVE andbehavior of theOverwrite Header If aresourceexistsat the destination. Subsequent alterations to the destinationandresource will not modify theOverwrite header is "T" then priorsource resource. Subsequent alterations toperformingthemovesource resource will not modify theserver MUST perform aDusseault & Crawford Expires January15, 200516, 2006 [Page45]44] Internet-Draft RFC2518bis July2004 DELETE with "Depth: infinity" on the2005 destination resource.If the Overwrite header is set to "F" then the operation will fail. 8.10.4 Status Codes 201 (Created) - The source resource was successfully moved, and8.9.2 COPY for Properties After anew resource was created atsuccessful COPY invocation, all dead properties on thedestination. 204 (No Content) - Thesource resourcewas successfully moved to a pre-existing destination resource. 207 (Multi-Status) - Multiple resources were toMUST beaffected by the MOVE, but errorsduplicated onsome of them prevented the operation from taking place. Specific error messages, together with the most appropriate ofthesource anddestinationURLs, appearresource, along with all properties as appropriate. Live properties described in this document SHOULD be duplicated as identically behaving live properties at thebody ofdestination resource, but not necessarily with themulti- status response. E.g. ifsame values. If asource resource was locked and could notproperty cannot bemoved,copied live, then its value MUST be duplicated, octet-for-octet, in an identically named, dead property on thesource resource URL appears with the 423 (Locked) status. 403 (Forbidden) - The source anddestinationresources are the same. 409 (Conflict) -resource. A COPY operation creates a new resource, much like a PUT operation does. Live properties which are related to resourcecannot be created at the destination until one or more intermediate collectionscreation (such as creationdate) should havebeen created.their values set accordingly. 8.9.3 COPY for Collections TheserverCOPY method on a collection without a Depth header MUSTNOT create those intermediate collections automatically. Or, the serveract as if a Depth header with value "infinity" wasunable to preserve the behaviorincluded. A client may submit a Depth header on a COPY on a collection with a value of "0" or "infinity". Servers MUST support thelive properties"0" andstill move"infinity" Depth header behaviors on WebDAV-compliant resources. A COPY of depth infinity instructs that the collection resource identified by the Request-URI is to be copied to thedestination (see 'live-properties-not-preserved' postcondition). 412 (Precondition Failed) Ș A condition failed, e.g.location identified by theOverwrite header is "F"URI in the Destination header, and all its internal member resources are to be copied to a location relative to it, recursively through all levels of thestatecollection hierarchy. Servers should of course avoid infinite recursion, and can do so by copying thedestination resource is non-null. 423 (Locked) - Thesourceorresource as it existed at thedestination resource, or somepoint where processing started. A COPY of "Depth: 0" only instructs that the collection and its properties but not resources identified by its internal member URLs, are to be copied. Any headers included with a COPY MUST be applied in processing every resourcewithinto be copied with thesource or destination collection, was locked. This response SHOULD containexception of the'missing-lock-token' precondition element. 502 (Bad Gateway) - This may occur whenDestination header. The Destination header only specifies the destinationis on another server andURI for thedestination server refusesRequest-URI. When applied toacceptmembers of theresource. This could also occur whencollection identified by thedestination is on another sub-section ofRequest-URI thesame server namespace. 8.10.5 Examples This example shows resource http://www.ics.uci.edu/~fielding/ index.html being movedvalue of Destination is to be modified to reflect the current locationhttp://www.ics.uci.edu/users/ f/fielding/index.html. The contents ofin thedestination resource would have been overwrittenhierarchy. So, if thedestination resource had been non-null. In this case, since there was nothing atRequest-URI is /a/ with Host header value http://example.com/ and thedestinationDestination is http://example.com/b/ then when http://example.com/a/c/d is processed it must use a Destination of http://example.com/b/c/d. Dusseault & Crawford Expires January15, 200516, 2006 [Page46]45] Internet-Draft RFC2518bis July2004 resource,2005 When theresponse code is 201 (Created). MOVE ofCOPY method has completed processing it MUST have created aNon-Collection >>Request MOVE /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html >>Response HTTP/1.1 201 Created Location: http://www.ics.uci.edu/users/f/fielding/index.html MOVEconsistent namespace at the destination (see Section 8.7.2for the definition ofa Collection >>Request MOVE /container/ HTTP/1.1 Host: www.example.com Destination: http://www.example.com/othercontainer/ Overwrite: F If: (<opaquelocktoken:fe184f2e-6eec-41d0-c765-01adc56e6bb4>) (<opaquelocktoken:e454f3f3-acdc-452a-56c7-00a5c91e4b77>) >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d='DAV:'> <d:response> <d:href>http://www.example.com/othercontainer/C2/</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> In this examplenamespace consistency). However, if an error occurs while copying an internal collection, theclient has submitted a numberserver MUST NOT copy any resources identified by members oflock tokens withthis collection (i.e., therequest. A lock token will need to be submitted for every resource, both source and destination, anywhere inserver must skip this subtree), as this would create an inconsistent namespace. After detecting an error, thescopeCOPY operation SHOULD try to finish as much of themethod, that is locked. In this case the proper lock token was not submitted fororiginal copy operation as possible (i.e., thedestination http://www.example.com/othercontainer/ C2/. This meansserver should still attempt to copy other subtrees and their members, thatthe resource /container/C2/ couldare notbe moved. Because there was an error moving /container/C2/, nonedescendents of/container/ Dusseault & Crawford Expires January 15, 2005 [Page 47] Internet-Draft RFC2518bis July 2004 C2's members were moved. However no errors were listedan error-causing collection). So, forthose members dueexample, if an infinite depth copy operation is performed on collection /a/, which contains collections /a/b/ and /a/c/, and an error occurs copying /a/b/, an attempt should still be made tothecopy /a/c/. Similarly, after encountering an errorminimization rules. User agent authentication has previously occurred viacopying amechanism outsidenon- collection resource as part of an infinite depth copy, thescopeserver SHOULD try to finish as much of theHTTP protocol, inoriginal copy operation as possible. If anunderlying transport layer. 8.11 LOCK Method The following sections describeerror in executing theLOCK method, which is used to take outCOPY method occurs with alock of any access type and to refresh an existing lock. These sections onresource other than theLOCK method describe only those semantics that are specific toresource identified in theLOCK methodRequest-URI then the response MUST be a 207 (Multi-Status), andare independent oftheaccess typeURL of thelock being requested. Anyresourcewhich supportscausing theLOCK method MUST, at minimum, supportfailure MUST appear with theXML request andspecific error. The 424 (Failed Dependency) status code SHOULD NOT be returned in the 207 (Multi-Status) responseformats defined herein. A LOCK method invocation to an unlocked resource createsfrom alock on the resource identified byCOPY method. These responses can be safely omitted because theRequest-URI, which becomesclient will know that therootprogeny ofthe lock. Lock method requests to create a new lock MUST haveaXML request body which containsresource could not be copied when the client receives anowner XML element and other informationerror forthis lock request. The server MUST preserve the information provided bytheclientparent. Additionally 201 (Created)/204 (No Content) status codes SHOULD NOT be returned as values in 207 (Multi-Status) responses from COPY methods. They, too, can be safely omitted because they are theowner field whendefault success codes. 8.9.4 COPY and thelock information is requested. The LOCK request MAY haveOverwrite Header If aTimeout header. Clients MUST assume that locks may arbitrarily disappearresource exists atany time, regardless of the value given intheTimeout header. The Timeoutdestination and the Overwrite headeronly indicatesis "T" then prior to performing thebehavior ofcopy the serverif extraordinary circumstances do not occur. For example, a sufficiently privileged user may remove a lock at any time or the system may crash in suchMUST perform away that it losesDELETE with "Depth: infinity" on therecord ofdestination resource. If thelock's existence. The response MUST containOverwrite header is set to "F" then thevalue ofoperation will fail. (Extensions to WebDAV might not follow this rule to thelockdiscovery property inletter but must consider backwards compatibility with clients that expect COPY to work this way.) Interoperability testing has shown that some clients expect aprop XML element. A success responsecollection COPY to actually do aLOCK request MUST include the Lock-Token response header with the token associatedmerge if a destination collection exists. That behavior is appropriate for file system folders but not necessarily for other data objects modelled as collections. Thus, implementors are urged to comply with thenew lock,standard language above, Dusseault & Crawford Expires January 16, 2006 [Page 46] Internet-Draft RFC2518bis July 2005 andMUST containleave clients to perform abody with the value of the 'lockdiscovery' property. Note that the Lock-Token header would not be returned inmanual merge if that's theresponse for a successful refresh LOCK request becauseexpected behavior when copying anew lockcollection over another collection. 8.9.5 Status Codes 201 (Created) - The source resource wasnot created.successfully copied. Thescope of a lock iscopy operation resulted in theentire statecreation ofthe resource, including its body and associated properties. As a result,alock on a resource MUST also lock the resource's properties. For collections,new resource. 204 (No Content) - The source resource was successfully copied to alock also affects the abilitypre-existing destination resource. 207 (Multi-Status) - Multiple resources were toadd or remove members. The naturebe affected by the COPY, but errors on some of them prevented theeffect depends uponoperation from taking place. Specific error messages, together with thetype of access control involved. This means that if a collection is locked, its lock-token is required in all these cases: Dusseault & Crawford Expires January 15, 2005 [Page 48] Internet-Draft RFC2518bis July 2004 o DELETE a collection's direct internal member o MOVE a member outmost appropriate of thecollection o MOVE a member into the collection, unless it overwrites a pre- existing member o MOVE to rename it within a collection, o COPY a member into a collection, unless it overwrites a pre- existing member o PUT or MKCOL request which would create a new member. The collection's lock token is requiredsource and destination URLs, appear inaddition tothelock token onbody of theinternal member itself,multi- status response. E.g. ifit exists. The interaction ofaLOCKdestination resource was locked and could not be overwritten, then the destination resource URL appears withvarious methodsthe 423 (Locked) status. 403 (Forbidden) - The operation isdependent uponforbidden. Possibly this is because thelock type. However, independent of lock type, a successful DELETE of asource and destination resources are the same resource. 409 (Conflict) - A resourceMUST cause all of its direct locks tocannot beremoved. 8.11.1 Refreshing Locks A lock is refreshed by sending a LOCK request without a body to a resource within the scope of the lock. A LOCK request to refresh a lock must specify which lock to refresh by usingcreated at theLock-Token header with a single lock token (onlydestination until onelock may be refreshed at a time). This requestor more intermediate collections have been created. The server MUST NOTcontain a body, but it may contain a Timeout header.create those intermediate collections automatically. 412 (Precondition Failed) - Aserver MAY acceptprecondition failed, e.g. theTimeoutOverwrite headerto change the duration remaining on the lock tois "F" and thenew value. A server MUST ignorestate of theDepth header on a LOCK refresh, anddestination resource is non-null. 423 (Locked) - The destination resource, or resource within theclientdestination collection, was locked. This response SHOULDNOT sendcontain theDepth header'missing-lock-token' precondition element. 502 (Bad Gateway) - This may occur when the destination is ona LOCK refresh asanother server, repository or namespace. Either theserver willsource namespace does notconvertsupport copying to thelockdestination namespace, orconfirmthedepth. Ifdestination namespace refuses to accept the resource. The client may wish to try GET/PUT and PROPFIND/PROPPATCH instead. 507 (Insufficient Storage) - The destination resourcehas other (shared) locks, those locks are unaffected by a lock refresh. Additionally, those locks dodoes notprevent the named lock from being refreshed. Note that in RFC2518, clients were indicated throughhave sufficient space to record theexample instate of thetext to useresource after theIf header to specify what lock to refresh (rather than the Lock-Token header). Servers are encouraged to continue to supportexecution of thisas well asmethod. 8.9.6 COPY Examples This example shows resource http://www.ics.uci.edu/~fielding/index.html being copied to theLock-Token header. 8.11.2 Depth and Lockinglocation http://www.ics.uci.edu/users/f/fielding/index.html. TheDepth header may be used204 Dusseault & Crawford Expires January 16, 2006 [Page 47] Internet-Draft RFC2518bis July 2005 (No Content) status code indicates the existing resource at the destination was overwritten. COPY with Overwrite >>Request COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html >>Response HTTP/1.1 204 No Content The following example shows theLOCK method. Values other than 0 or infinity MUST NOT be usedsame copy operation being performed, but with theDepthOverwrite headeron a LOCK method. All resources that support the LOCK method MUST support the Depth header.set to "F." ADepth headerresponse ofvalue 0 means to just lock412 (Precondition Failed) is returned because the destination resourcespecified by the Request-URI.has a non-null state. COPY with No Overwrite >>Request COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Overwrite: F >>Response HTTP/1.1 412 Precondition Failed Dusseault & Crawford Expires January15, 200516, 2006 [Page49]48] Internet-Draft RFC2518bis July2004 If the2005 Example - COPY of a Collection >>Request COPY /container/ HTTP/1.1 Host: www.example.com Destination: http://www.example.com/othercontainer/ Depth: infinity >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d="DAV:"> <d:response> <d:href>http://www.example.com/othercontainer/R2/</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> The Depth header isset to infinity thenunnecessary as theresource specified indefault behavior of COPY on a collection is to act as if a "Depth: infinity" header had been submitted. In this example most of theRequest-URIresources, along withall its internal members, alltheway downcollection, were copied successfully. However thehierarchy, are to be locked. A successful result MUST return a single lock token which represents allcollection R2 failed because theresources that have beendestination R2 is locked.IfBecause there was anUNLOCK is successfully executederror copying R2, none of R2's members were copied. However no errors were listed for those members due to the error minimization rules. 8.10 MOVE The MOVE operation onthis token,a non-collection resource is the logical equivalent of a copy (COPY), followed by consistency maintenance processing, followed by a delete of the source, where allassociated resourcesthree actions areunlocked. Ifperformed atomically. The consistency maintenance step allows thelock cannot be grantedserver to perform updates caused by the move, such as updating allresources, a 207 (Multi-Status) status code MUST be returned with a response entity body containing a multistatus XML element describingURLs other than the Request-URI whichresource(s) preventedidentify thelock from being granted. Hence, partial success is not an option. Eithersource resource, to point to theentire hierarchy is locked or no resources are locked. If no Depthnew destination resource. Consequently, the Destination headeris submittedMUST be present ona LOCK request thenall MOVE methods and MUST follow all COPY requirements for therequestCOPY part of the MOVE method. All WebDAV compliant resources MUSTact as if a "Depth:infinity" had been submitted. 8.11.3 Locking Unmapped URLs A successful LOCKsupport the MOVE method. However, support for the MOVE methodMUST result indoes not guarantee thecreation of an emptyability to move a resourcewhich is locked (and which isto a particular destination. Dusseault & Crawford Expires January 16, 2006 [Page 49] Internet-Draft RFC2518bis July 2005 For example, separate programs may actually control different sets of resources on the same server. Therefore, it may not be possible to move acollection), whenresource within a namespace that appears to belong to the same server. If a resourcedid not previously existexists atthat URL. Later on,thelock may go away butdestination, theemptydestination resourceremains. Empty resources MUST then appearwill be deleted as a side-effect of the MOVE operation, subject to the restrictions of the Overwrite header. 8.10.1 MOVE for Properties Live properties described inPROPFIND responses includingthis document MUST be moved along with the resource, such thatURL intheresponse scope. Aresource has identically behaving live properties at the destination resource, but not necessarily with the same values. If the live properties will not work the same way at the destination, the server MUSTrespond successfully to a GETfail the requestto an empty resource, either by using a 204 No Content response, or by using 200 OK with(the client can perform COPY then DELETE if it wants aContent-Length header indicating zero length and no Content-Type. 8.11.4 Lock Compatibility Table The table below describesMOVE to work that badly). This can mean that the server reports the live property as "Not Found" if that's the most appropriate behavior for thatoccurs when a lock requestlive property at the destination, as long as the live property ismade on a resource. Current State Shared Lock Request Exclusive Lock Request -------------------------------------------------------------------- None True True Shared Lock True False Exclusive Lock False False* Legend: True = lock may be granted. False = lock MUST NOT be granted. *=Itstill supported with the same semantics. MOVE isillegal forfrequently used by clients to rename aprincipalfile without changing its parent collection, so it's not appropriate torequestreset live properties which are set at resource creation. For example, the creationdate property value SHOULD remain the samelock twice. The current lock state ofafter aresource is givenMOVE. Dead properties must be moved along with the resource. 8.10.2 MOVE for Collections A MOVE with "Depth: infinity" instructs that the collection identified by the Request-URI be moved to the address specified in theleftmost column,Destination header, andlock requestsall resources identified by its internal member URLs arelisted in the first row. The intersectionto be moved to locations relative to it, recursively through all levels ofa row and column givestheresult ofcollection hierarchy. The MOVE method on alock request. For example,collection MUST act as if ashared lock is held"Depth: infinity" header was used on it. A client MUST NOT submit aresource, and an exclusive lock is Dusseault & Crawford Expires January 15, 2005 [Page 50] Internet-Draft RFC2518bis July 2004 requested, the table entry is "false", indicating the lock must not be granted. 8.11.5 LOCK responses 200 (OK) - The lock request succeeded and theDepth header on a MOVE on a collection with any valueof the lockdiscovery property isbut "infinity". Any headers included with MOVE MUST be applied inthe body. 409 (Conflict) - Aprocessing every resourcecannotto be moved with the exception of the Destination header. The behavior of the Destination header is the same as given for COPY on collections. When the MOVE method has completed processing it MUST have created a consistent namespace at both the source and destinationuntil one or more intermediate collections have been created. The(see section Dusseault & Crawford Expires January 16, 2006 [Page 50] Internet-Draft RFC2518bis July 2005 5.1 for the definition of namespace consistency). However, if an error occurs while moving an internal collection, the server MUST NOTcreate those intermediate collections automatically. 412 (Precondition Failed) - The included lock token was not enforceable on this resource ormove any resources identified by members of theserver could not satisfyfailed collection (i.e., therequest inserver must skip thelockinfo XML element. 423 (Locked) - The resource is locked already. For consistency's sake,error-causing subtree), as thisresponse SHOULD containwould create an inconsistent namespace. In this case, after detecting the'missing-lock-token' precondition element. 400 (Bad Request), with 'request-uri-must-match-lock-token' precondition - The LOCK request was made with a Lock-Token header, indicating thaterror, theclient wishesmove operation SHOULD try torefresh the given lock. However,finish as much of theRequest-URI did not fall withinoriginal move as possible (i.e., thescope ofserver should still attempt to move other subtrees and thelockresources identified bythe token. The lock may have a scopetheir members, thatdoesare notinclude the Request-URI, or the lock could have disappeared, or the token may be invalid. 8.11.6 Example - Simple Lock Request >>Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." <?xml version="1.0" encoding="utf-8" ?> <D:lockinfo xmlns:D='DAV:'> <D:lockscope><D:exclusive/></D:lockscope> <D:locktype><D:write/></D:locktype> <D:owner> <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href> Dusseault & Crawford Expires January 15, 2005 [Page 51] Internet-Draft RFC2518bis July 2004 </D:owner> </D:lockinfo> >>Response HTTP/1.1 200 OK Lock-Token: <opaquelocktoken:e71d4fae-5dec-22d6-fea5-00a0c91e6be4> Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:prop xmlns:D="DAV:"> <D:lockdiscovery> <D:activelock> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:depth>infinity</D:depth> <D:owner> <D:href> http://www.ics.uci.edu/~ejw/contact.html </D:href> </D:owner> <D:timeout>Second-604800</D:timeout> <D:locktoken> <D:href>opaquelocktoken:e71d4fae-5dec-22d6-fea5- 00a0c91e6be4</D:href> </D:locktoken> <D:lockroot> <D:href>http://example.com/workspace/webdav /proposal.doc</D:href> </D:lockroot> </D:activelock> </D:lockdiscovery> </D:prop> This example shows the successful creationdescendents of anexclusive write lockerror-causing collection). So, for example, if an infinite depth move is performed onresource http://example.com/workspace/webdav/proposal.doc. The resource http://www.ics.uci.edu/~ejw/contact.htmlcollection /a/, which containscontact information for the ownercollections /a/b/ and /a/c/, and an error occurs moving /a/b/, an attempt should still be made to try moving /a/c/. Similarly, after encountering an error moving a non- collection resource as part of an infinite depth move, thelock. TheserverhasSHOULD try to finish as much of the original move operation as possible. If anactivity-based timeout policyerror occurs with a resource other than the resource identified inplace on this resource, which causesthelock to automatically be removed after 1 week (604800 seconds). Note thatRequest-URI then thenonce, response,response MUST be a 207 (Multi-Status), andopaque fields have not been calculated intheAuthorization request header. Note thaterrored resource's URL MUST appear with thelocktoken and lockroot href elements would not contain any whitespace.specific error. Theline return appearing424 (Failed Dependency) status code SHOULD NOT be returned inthis document is only for formatting. Dusseault & Crawford Expires January 15, 2005 [Page 52] Internet-Draft RFC2518bis July 2004 8.11.7 Example - Refreshingthe 207 (Multi-Status) response from aWrite Lock >>Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Lock-Token: <opaquelocktoken:e71d4fae-5dec-22d6-fea5-00a0c91e6be4> Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." >>Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:prop xmlns:D="DAV:"> <D:lockdiscovery> <D:activelock> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:depth>infinity</D:depth> <D:owner> <D:href> http://www.ics.uci.edu/~ejw/contact.html </D:href> </D:owner> <D:timeout>Second-604800</D:timeout> <D:locktoken> <D:href>opaquelocktoken:e71d4fae-5dec-22d6-fea5- 00a0c91e6be4</D:href> </D:locktoken> <D:lockroot> <D:href>http://example.com/workspace/webdav /proposal.doc</D:href> </D:lockroot> </D:activelock> </D:lockdiscovery> </D:prop> This request would refreshMOVE method. These errors can be safely omitted because thelock, attempting to resetclient will know that thetimeout toprogeny of a resource could not be moved when thenew value specifiedclient receives an error for the parent. Additionally 201 (Created)/204 (No Content) responses SHOULD NOT be returned as values in 207 (Multi-Status) responses from a MOVE. These responses can be safely omitted because they are thetimeout header. Notice thatdefault success codes. 8.10.3 MOVE and theclient asked for an infinite time out butOverwrite Header If a resource exists at theserver choosedestination and the Overwrite header is "T" then prior toignore Dusseault & Crawford Expires January 15, 2005 [Page 53] Internet-Draft RFC2518bis July 2004performing therequest. In this example,move thenonce, response, and opaque fields have not been calculated inserver MUST perform a DELETE with "Depth: infinity" on theAuthorization request header. 8.11.8 Exampledestination resource. If the Overwrite header is set to "F" then the operation will fail. 8.10.4 Status Codes 201 (Created) -Multi-Resource Lock Request >>Request LOCK /webdav/ HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Depth: infinity Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." <?xml version="1.0" encoding="utf-8" ?> <D:lockinfo xmlns:D="DAV:"> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:owner> <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href> </D:owner> </D:lockinfo> >>Response HTTP/1.1The source resource was successfully moved, and a new resource was created at the destination. 204 (No Content) - The source resource was successfully moved to a pre-existing destination resource. 207Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://example.com/webdav/secret</D:href> <D:status>HTTP/1.1 403 Forbidden</D:status> </D:response> <D:response> <D:href>http://example.com/webdav/</D:href> <D:propstat> <D:prop><D:lockdiscovery/></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> </D:response> </D:multistatus>(Multi-Status) - Multiple resources were to be affected by the MOVE, but errors on some of them prevented the operation from taking place. Specific error messages, together with the most appropriate of the source and destination URLs, appear in the body of the multi- Dusseault & Crawford Expires January15, 200516, 2006 [Page54]51] Internet-Draft RFC2518bis July2004 This example shows a request for an exclusive write lock on a collection and all its children. In this request, the client has specified that it desires an infinite length lock,2005 status response. E.g. ifavailable, otherwiseatimeout of 4.1 billion seconds, if available. The request entity body contains the contact information forsource resource was locked and could not be moved, then theprincipal taking outsource resource URL appears with thelock, in this case a web page URL. The error is a423 (Locked) status. 403 (Forbidden)response on- The source and destination resources are the same. 409 (Conflict) - A resourcehttp:// example.com/webdav/secret. Because this resource could notcannot belocked, none ofcreated at theresources were locked. Note also that the lockdiscovery property for the Request-URI hasdestination until one or more intermediate collections have beenincluded as required. In this examplecreated. The server MUST NOT create those intermediate collections automatically. Or, thelockdiscovery property is empty which means that there are no outstanding locks onserver was unable to preserve theresource. In this example,behavior of thenonce, response,live properties andopaque fields have not been calculated in the Authorization request header. 8.12 UNLOCK Method The UNLOCK method removesstill move thelock identified byresource to thelock token indestination (see 'live- properties-not-preserved' postcondition). 412 (Precondition Failed) n A condition failed, e.g. theLock-Token request header. The Request-URI MUST identify a resource withinOverwrite header is "F" and thescopestate of thelock. The If headerdestination resource isnot needed to providenon-null. 423 (Locked) - The source or thelock token although serversdestination resource, or some resource within the source or destination collection, was locked. This response SHOULDstill evaluatecontain theIf header'missing-lock-token' precondition element. 502 (Bad Gateway) - This may occur when the destination is on another server andtreat it as a conditional header. For a successful response to this method,the destination serverMUST removerefuses to accept thelock fromresource. This could also occur when the destination is on another sub-section of the same server namespace. 8.10.5 Examples This example shows resourceidentified byhttp://www.ics.uci.edu/~fielding/index.html being moved to theRequest-URI and from all other resources included inlocation http://www.ics.uci.edu/users/f/fielding/index.html. The contents of thelock. If all resources whichdestination resource would have beenlocked under the submitted lock token can not be unlocked thenoverwritten if theUNLOCK request MUST fail. A successful response to an UNLOCK method does not mean that the resource is necessarily unlocked. It means that the specific lock corresponding to the specified token no longer exists. Any DAV compliantdestination resourcewhich supportshad been non-null. In this case, since there was nothing at theLOCK method MUST supportdestination resource, theUNLOCK method. 8.12.1 Status Codes 204 (No Content) - Normal successresponse400 (Bad Request) - No lock token was provided (see 'missing-lock-token' precondition), or request was made to a Request-URI that was not within the scopecode is 201 (Created). MOVE ofthe lock (see 'requesturi-must-match-lock-token' precondition).a Non-Collection >>Request MOVE /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html >>Response HTTP/1.1 201 Created Location: http://www.ics.uci.edu/users/f/fielding/index.html Dusseault & Crawford Expires January15, 200516, 2006 [Page55]52] Internet-Draft RFC2518bis July2004 403 (Forbidden) - The currently authenticated principal does not have permission to remove the lock (the server SHOULD use the 'need-privileges' precondition element). 412 (Precondition Failed) - The resource was not locked. 8.12.2 Example2005 MOVE of a Collection >>RequestUNLOCK /workspace/webdav/info.docMOVE /container/ HTTP/1.1 Host:example.com Lock-Token: <opaquelocktoken:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7> Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..."www.example.com Destination: http://www.example.com/othercontainer/ Overwrite: F If: (<opaquelocktoken:fe184f2e-6eec-41d0-c765-01adc56e6bb4>) (<opaquelocktoken:e454f3f3-acdc-452a-56c7-00a5c91e4b77>) >>Response HTTP/1.1204 No Content207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <d:multistatus xmlns:d='DAV:'> <d:response> <d:href>http://www.example.com/othercontainer/C2/</d:href> <d:status>HTTP/1.1 423 Locked</d:status> </d:response> </d:multistatus> In thisexample,example the client has submitted a number of lockidentified bytokens with the request. A lock token"opaquelocktoken:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7" is successfully removed from the resource http://example.com/workspace/ webdav/info.doc. If this lock included more than just onewill need to be submitted for every resource,the lock is removed from all resources includedboth source and destination, anywhere in thelock. The 204 (No Content) status code is used insteadscope of200 (OK) because therethe method, that isno response entity body.locked. In thisexample,case thenonce, response, and opaque fields haveproper lock token was notbeen calculatedsubmitted for the destination http://www.example.com/othercontainer/C2/. This means that the resource /container/C2/ could not be moved. Because there was an error moving /container/C2/, none of /container/C2's members were moved. However no errors were listed for those members due to the error minimization rules. User agent authentication has previously occurred via a mechanism outside the scope of the HTTP protocol, in an underlying transport layer. 8.11 LOCK Method The following sections describe theAuthorization request header.LOCK method, which is used to take out a lock of any access type and to refresh an existing lock. These sections on the LOCK method describe only those semantics that are specific to the LOCK method and are independent of the access type of the lock being requested. Any resource which supports the LOCK method MUST, at minimum, support Dusseault & Crawford Expires January15, 200516, 2006 [Page56]53] Internet-Draft RFC2518bis July2004 9. HTTP Headers for Distributed Authoring All DAV headers follow2005 thesame basic formatting rules as HTTP headers. This includes rules like line continuationXML request andhowresponse formats defined herein. A LOCK method invocation tocombine (or separate) multiple instances ofan unlocked resource creates a lock on thesame header using commas. 9.1 DAV Header DAV = "DAV" ":" #( compliance-code ) compliance-code = ( "1" | "2" | "bis" | extend ) extend = Coded-URL | token This general-header appearing inresource identified by theresponse indicates thatRequest-URI, which becomes theresource supportsroot of theDAV schemalock. Lock method requests to create a new lock MUST have a XML request body which contains an owner XML element andprotocol as specified. All DAV compliant resourcesother information for this lock request. The server MUSTreturnpreserve theDAV header on all OPTIONS responses. The valueinformation provided by the client in the owner field when the lock information is requested. The LOCK request MAY have acomma-separated list of all compliance class identifiersTimeout header. Clients MUST assume thatthe resource supports. Class identifierslocks maybe Coded-URLs or tokens (as defined by [RFC2616]). Identifiers can appear inarbitrarily disappear at anyorder. Identifiers that are standardized throughtime, regardless of theIETF RFC process are tokens, but other identifiers SHOULD be Coded- URLs to encourage uniqueness. A resource must show class 1 compliancevalue given in the Timeout header. The Timeout header only indicates the behavior of the server ifit shows class 2 or "bis" compliance. In general, support for one compliance class doesextraordinary circumstances do notentail support foroccur. For example, a sufficiently privileged user may remove a lock at anyother. Please refer to section 16 for more details on compliance classes defined in this specification. This header must also appear on responses to OPTIONS requests totime or thespecial '*' Request-URI as definedsystem may crash inHTTP/1.1. In this case it meanssuch a way that it loses therepository supportsrecord of thenamed features in at least some internal namespaces. As an optional request header, this header allowslock's existence. When a new lock is created, theclient to advertise complianceLOCK response: MUST contain a body withnamed features. Clients need not advertise 1, 2 or bis becausethe value of the lockdiscovery property in aWebDAV server currently doesn't need that informationprop XML element. MUST include the Lock-Token response header with the token associated with the new lock. 8.11.1 Refreshing Locks A lock is refreshed by sending a LOCK request without a body todecide howa resource within the scope of the lock. A LOCK request torespondrefresh a lock must specify which lock torequests defined in this specification or in HTTP/1.1. However, future extensionsrefresh by using the Lock-Token header with a single lock token (only one lock maydefine client compliance codes. When used asbe refreshed at a time). This requestheader,MUST NOT contain a body, but it may contain a Timeout header. A server MAY accept theDAVTimeout headerMAY affect caching so thisto change the duration remaining on the lock to the new value. A server MUST ignore the Depth header on a LOCK refresh, and the client SHOULD NOTbe used on all GET requests. Dusseault & Crawford Expires January 15, 2005 [Page 57] Internet-Draft RFC2518bis July 2004 9.2 Depth Header Depth = "Depth" ":" ("0" | "1" | "infinity") Thesend the Depthrequestheaderis used with methods executedonresources which could potentially have internal members to indicate whethera LOCK refresh as themethod is to be applied only toserver will not convert theresource ("Depth: 0"), tolock or confirm the depth. If the resourceand its immediate children, ("Depth: 1"), or the resource and all its progeny ("Depth: infinity"). The Depth header is only supported if a method's definition explicitly provides for such support. The following ruleshas other (shared) locks, those locks are unaffected by a lock refresh. Additionally, those locks do not prevent thedefault behavior for any methodnamed lock from being refreshed. Note thatsupportsin RFC2518, clients were indicated through theDepth header. A method may override these defaults by defining different behaviorexample inits definition. Methods which supporttheDepthtext to use the If headermay choose nottosupport all ofspecify what lock to refresh (rather than theheader's values and may define, on a case by case basis,Lock-Token header). Servers are encouraged to continue to support this as well as thebehavior ofLock-Token header. Dusseault & Crawford Expires January 16, 2006 [Page 54] Internet-Draft RFC2518bis July 2005 Note that themethod if a DepthLock-Token header is notpresent. For example,be returned in theMOVE method only supports "Depth: infinity" and ifresponse for a successful refresh LOCK request, but the LOCK response body MUST contain the new value for the lockdiscovery body. 8.11.2 Depth and Locking The Depth headeris not present will act as if a "Depth: infinity" header had been applied. Clientsmay be used with the LOCK method. Values other than 0 or infinity MUST NOTrely upon methods executing on members of their hierarchies in any particular order or on the execution being atomic unless the particular method explicitly provides such guarantees. Upon execution, a methodbe used withathe Depth headerwill perform as much of its assigned task as possible and then return a response specifying what it was able to accomplish and what it failed to do. So, for example, an attempt to COPY a hierarchy may result in some of the members being copied and some not. Any headerson amethodLOCK method. All resources thathas a defined interaction withsupport theDepth headerLOCK method MUSTbe applied to all resources in the scope ofsupport themethod except where alternative behavior is explicitly defined. For example, an If-MatchDepth header. A Depth headerwill have itsof valueapplied against every resource in the method's scope and will cause the method0 means tofail ifjust lock theheader fails to match. If a resource, source or destination, withinresource specified by thescope ofRequest-URI. If themethod with aDepth header islocked in such a way asset topreventinfinity then thesuccessful execution ofresource specified in themethod, thenRequest-URI along with all its internal members, all the way down the hierarchy, are to be locked. A successful result MUST return a single lock tokenforwhich represents all the resources thatresourcehave been locked. If an UNLOCK is successfully executed on this token, all associated resources are unlocked. If the lock cannot be granted to all resources, a 207 (Multi-Status) status code MUST besubmittedreturned with a response entity body containing a multistatus XML element describing which resource(s) prevented therequest inlock from being granted. Hence, partial success is not an option. Either the entire hierarchy is locked or no resources are locked. Ifrequest header. Theno Depth headeronly specifies the behavior of the method with Dusseault & Crawford Expires January 15, 2005 [Page 58] Internet-Draft RFC2518bis July 2004 regards to internal children. Ifis submitted on aresource does not have internal childrenLOCK request then theDepth headerrequest MUSTbe ignored. Please note, however, that it is always an error to submitact as if avalue for"Depth:infinity" had been submitted. 8.11.3 Locking Unmapped URLs A successful LOCK method MUST result in theDepth header thatcreation of an empty resource which is locked (and which is notallowed by the method's definition. Thus submittinga"Depth: 1" oncollection), when aCOPY, even if theresourcedoes not have internal members, will result in a 400 (Bad Request). The method should faildid notbecausepreviously exist at that URL. Later on, theresource doesn't have internal members,lock may go away butbecause of the illegal value in the header. 9.3 Destination Header Destination = "Destination" ":" ( absoluteURI ) The Destination request header specifiestheURI which identifies a destinationempty resourcefor methods such as COPY and MOVE, which take two URIs as parameters. Noteremains. Empty resources MUST then appear in PROPFIND responses including thatthe absoluteURI production is definedURL inRFC2396 [6]. If the Destination value is an absolute URI, it may name a different server (or different port or scheme). Ifthesourceresponse scope. A servercannot attempt a copy to the remote server, itMUSTfail the request with a 502 (Bad Gateway) response. Servers MAY attemptrespond successfully tocopy the resourcea GET request tothe remote serveran empty resource, either by usingPUT/PROPPATCHa 204 No Content response, oranother mechanism. 9.4 Force-Authentication Header Force-Authentication = "Force-Authentication" ":" Method The Force-Authentication request header is used with the OPTIONS method to specify that the client wants to be challenged for authentication credentials to the resource identifiedbythe Request-URI. If present on a request to a WebDAV-compliant resource, the server MUST respondusing 200 OK witheither 401 (Unauthorized) or 501 (Not Implemented) status code. The Method value is used for the client to indicate what method it intends to use first on the resource identified in the Request-URI.a Content-Length header indicating zero length and no Content-Type. Dusseault & Crawford Expires January15, 200516, 2006 [Page59]55] Internet-Draft RFC2518bis July2004 9.5 If Header If = "If" ":" ( 1*No-tag-list | 1*Tagged-list) No-tag-list = List Tagged-list = Resource 1*List Resource = Coded-URL List = #( "(" List | Clause ")" ) Clause = ["Not"] State-token | State-token State-token = Coded-URL | "[" entity-tag "]" Coded-URL = "<" absoluteURI ">"2005 8.11.4 Lock Compatibility Table TheIftable below describes the behavior that occurs when a lock requestheaderisintended to have similar functionality to the If- Match header defined in section 14.24 of RFC2616 [8]. However the If headermade on a resource. Current State Shared Lock Request Exclusive Lock Request ---------------------------------------------------------------- None True True Shared Lock True False Exclusive Lock False False* Legend: True = lock may be granted. False = lock MUST NOT be granted. *=It isintendedillegal foruse with any URI which represents state information, referred to asa principal to request the same lock twice. The current lock statetoken, aboutof a resourceas well as ETags. A typical example of a state tokenisa lock token,given in the leftmost column, and locktokensrequests arethe only state tokens definedlisted inthis specification.the first row. The<DAV:no-lock> state tokenintersection of a row and column gives the result of a lock request. For example, if a shared lock is held on aspecial token that must never matchresource, and anactual validexclusive locktoken. The purpose of thisisdescribed in section 9.5.5. The If header's purposerequested, the table entry isto describe a series of state lists. If"false", indicating thestatelock must not be granted. 8.11.5 LOCK responses 200 (OK) - The lock request succeeded and the value of the lockdiscovery property is included in the body. 409 (Conflict) - A resourceto whichcannot be created at theheaderdestination until one or more intermediate collections have been created. The server MUST NOT create those intermediate collections automatically. 423 (Locked) - The resource isapplied does not match any of the specified state lists thenlocked already. For consistency's sake, this response SHOULD contain the 'missing-lock-token' precondition element. h 400 (Bad Request), with 'request-uri-must-match-lock-token' precondition - The LOCK requestMUST failwas made with a412 (Precondition Failed). If one ofLock-Token header, indicating that thedescribed state lists matchesclient wishes to refresh thestategiven lock. However, the Request-URI did not fall within the scope of theresource thenlock identified by therequest may succeed.token. Theserver must parse the If header when it appears on any request, evaluate alllock may have a scope that does not include theclauses, and ifRequest-URI, or theconditional evaluates to false, fail the request. Note that the absoluteURI production is defined in RFC2396 [6]. RFC2518 originally defined the If header without comma separators. This oversight meant that the If header couldn't be divided up among multiple lines according to the HTTP header manipulation rules. Servers supporting "bis" MUST be able to accept commas in If header values. If the header has commas between tokenslock could have disappeared, orclauses,theheader cantoken may beevaluated simply by removing the commas and proceeding with the evaluation rules. 9.5.1 No-tag-list Production The No-tag-list production describesinvalid. 424 (Failed Dependency) - This may appear inside aseries of state tokens and ETags. If multiple No-tag-list productions are used then one only needs to match the state of the resource for the method to be allowed207 response tocontinue. All untagged tokens applya LOCK request, totheindicate that a resourceidentified in the Request-URI.could not be locked because of a failure on another resource. Dusseault & Crawford Expires January15, 200516, 2006 [Page60]56] Internet-Draft RFC2518bis July20042005 8.11.6 Example -no-tag-list production If: (<opaquelocktoken:a-write-lock-token> ["I am an ETag"]), (["I am another ETag"]) The previous header would require that the resource identified in the Request-URI be locked with the specified lock token and in the state identified by the "I am an ETag" ETag or in the state identified by the second ETag "I am another ETag". To put the matter more plainly one can think of the previous If header as being in the form (or (and <opaquelocktoken:a-write-lock-token> ["I am an ETag"]) (and ["I am another ETag"])). 9.5.2 Tagged-list Production The tagged-list production scopes a list production. That is, it specifies that the lists followingSimple Lock Request >>Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." <?xml version="1.0" encoding="utf-8" ?> <D:lockinfo xmlns:D='DAV:'> <D:lockscope><D:exclusive/></D:lockscope> <D:locktype><D:write/></D:locktype> <D:owner> <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href> </D:owner> </D:lockinfo> >>Response HTTP/1.1 200 OK Lock-Token: <opaquelocktoken:e71d4fae-5dec-22d6-fea5-00a0c91e6be4> Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:prop xmlns:D="DAV:"> <D:lockdiscovery> <D:activelock> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:depth>infinity</D:depth> <D:owner> <D:href> http://www.ics.uci.edu/~ejw/contact.html </D:href> </D:owner> <D:timeout>Second-604800</D:timeout> <D:locktoken> <D:href>opaquelocktoken:e71d4fae-5dec-22d6-fea5- 00a0c91e6be4</D:href> </D:locktoken> <D:lockroot> Dusseault & Crawford Expires January 16, 2006 [Page 57] Internet-Draft RFC2518bis July 2005 <D:href>http://example.com/workspace/webdav /proposal.doc</D:href> </D:lockroot> </D:activelock> </D:lockdiscovery> </D:prop> This example shows the successful creation of an exclusive write lock on resourcespecification only apply to the specified resource.http://example.com/workspace/webdav/proposal.doc. Thescope of theresourceproduction begins withhttp://www.ics.uci.edu/~ejw/contact.html contains contact information for thelist production immediately followingowner of theresource production and ends withlock. The server has an activity- based timeout policy in place on this resource, which causes thenext resource production, if any. All clauses mustlock to automatically beevaluated. If the state ofremoved after 1 week (604800 seconds). Note that theresource namednonce, response, and opaque fields have not been calculated in thetag doesAuthorization request header. Note that the locktoken and lockroot href elements would notmatchcontain anyof the associated state lists then the request MUST fail with a 412 (Precondition Failed).whitespace. Thesame URI MUST NOT appear more than once in a resource productionline return appearing inan If header. Example - Tagged List If header COPY /resource1 HTTP/1.1 Host: www.example.com Destination: http://www.example.com/resource2 If: <http://www.example.com/resource1> (<locktoken:a-write-lock- token> [W/"A weak ETag"]), (["strong ETag"]), <http://www.bar.bar/random>(["another strong ETag"]) Inthisexample http://www.example.com/resource1document isbeing copiedonly for formatting. Dusseault & Crawford Expires January 16, 2006 [Page 58] Internet-Draft RFC2518bis July 2005 8.11.7 Example - Refreshing a Write Lock >>Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Lock-Token: <opaquelocktoken:e71d4fae-5dec-22d6-fea5-00a0c91e6be4> Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." >>Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:prop xmlns:D="DAV:"> <D:lockdiscovery> <D:activelock> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:depth>infinity</D:depth> <D:owner> <D:href> http://www.ics.uci.edu/~ejw/contact.html </D:href> </D:owner> <D:timeout>Second-604800</D:timeout> <D:locktoken> <D:href>opaquelocktoken:e71d4fae-5dec-22d6-fea5- 00a0c91e6be4</D:href> </D:locktoken> <D:lockroot> <D:href>http://example.com/workspace/webdav /proposal.doc</D:href> </D:lockroot> </D:activelock> </D:lockdiscovery> </D:prop> This request would refresh the lock, attempting tohttp://www.example.com/resource2. Whenreset themethod is first appliedtimeout tohttp://www.example.com/resource1, resource1 must be inthestatenew value specifiedby "(<locktoken:a-write-lock-token> [W/"A weak ETag"]) (["strong ETag"])", that is, it either must be locked with a lock token of "locktoken:a-write-lock-token" and have a weak entity tag W/ "A weak ETag" or it must have a strong entity tag "strong ETag". That isin theonly success condition sincetimeout header. Notice that theresource http:// www.bar.bar/random never hasclient asked for an infinite time out but themethod appliedserver choose toit (the only other resource listed in the If header) and http://www.example.com/ resource2 is not listed in the If header.ignore Dusseault & Crawford Expires January15, 200516, 2006 [Page61]59] Internet-Draft RFC2518bis July2004 9.5.3 Not Production Every state token or ETag is either current, and hence describes2005 thestate of a resource, or is not current,request. In this example, the nonce, response, anddoesopaque fields have notdescribebeen calculated in thestate of a resource. The boolean operation of matching a state token or ETag to the current state ofAuthorization request header. 8.11.8 Example - Multi-Resource Lock Request >>Request LOCK /webdav/ HTTP/1.1 Host: example.com Timeout: Infinite, Second-4100000000 Depth: infinity Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." <?xml version="1.0" encoding="utf-8" ?> <D:lockinfo xmlns:D="DAV:"> <D:locktype><D:write/></D:locktype> <D:lockscope><D:exclusive/></D:lockscope> <D:owner> <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href> </D:owner> </D:lockinfo> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://example.com/webdav/secret</D:href> <D:status>HTTP/1.1 403 Forbidden</D:status> </D:response> <D:response> <D:href>http://example.com/webdav/</D:href> <D:propstat> <D:prop><D:lockdiscovery/></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> </D:response> </D:multistatus> Dusseault & Crawford Expires January 16, 2006 [Page 60] Internet-Draft RFC2518bis July 2005 This example shows aresource thus resolves torequest for an exclusive write lock on atrue or false value. The "Not" production is used to reversecollection and all its children. In this request, the client has specified thatvalue. The scopeit desires an infinite length lock, if available, otherwise a timeout of 4.1 billion seconds, if available. The request entity body contains thenot production iscontact information for thestate-token or entity-tag immediately following it. If: (Not <locktoken:write1> <locktoken:write2>) When submitted with a request,principal taking out the lock, in thisIf header requires that all operand resources must not be locked with locktoken:write1 and must be locked with locktoken:write2.case a web page URL. TheNot productionerror isparticularly useful witha 403 (Forbidden) response on the"<DAV:no-lock>" state token. The clause "Not <DAV:no-lock>" must evaluate to true. Thus, any "OR" statement containingresource http://example.com/webdav/secret. Because this resource could not be locked, none of theclause "Not <DAV:no-lock>" mustresources were locked. Note alsoevaluate to true. 9.5.4 Matching Function When performing If header processing, the definition of a matching state token or entity tag is as follows. Identifying a resource: The resource is identified by the URI along withthat thetoken, in tagged list production, or bylockdiscovery property for the Request-URIin untagged list production. Matching entity tag: Wherehas been included as required. In this example theentity tag matches an entity tag associated withlockdiscovery property is empty which means that there are no outstanding locks on theidentifiedresource.Matching state token: Where there is an exact match betweenIn this example, thestate tokennonce, response, and opaque fields have not been calculated in theIf header and any state token onAuthorization request header. 8.12 UNLOCK Method The UNLOCK method removes the lock identifiedresource. Aby the lockstatetokenis considered to match ifin the Lock-Token request header. The Request-URI MUST identify a resourceis anywhere inwithin the scope of the lock.Example - Matching lock tokens with collection locks DELETE /specs/rfc2518.txt HTTP/1.1 Host: www.example.com If: <http://www.example.com/specs/> (<locktoken:a-write-lock-token>) For this example,The If header is not needed to provide the lock tokenmust be comparedalthough servers SHOULD still evaluate the If header and treat it as a conditional header. For a successful response to this method, theidentified resource, which isserver MUST remove the'specs' collectionlock from the resource identified by theURLRequest-URI and from all other resources included in thetagged list production.lock. Ifthe 'specs' collection is notall resources which have been lockedor has aunder the submitted lockwith a different token,token can not be unlocked then the UNLOCK request MUST fail.If the DusseaultA successful response to an UNLOCK method does not mean that the resource is necessarily unlocked. It means that the specific lock corresponding to the specified token no longer exists. Any DAV compliant resource which supports the LOCK method MUST support the UNLOCK method. 8.12.1 Status Codes 204 (No Content) - Normal success response (rather than 200 OK, since 200 OK would imply a response body, and an UNLOCK success response does not normally contain a body) 400 (Bad Request) - No lock token was provided (see 'missing-lock- token' precondition), or request was made to a Request-URI that was not within the scope of the lock (see 'requesturi-must-match-lock- Dusseault & Crawford Expires January15, 200516, 2006 [Page62]61] Internet-Draft RFC2518bis July2004 'specs' collection is locked (depth infinity) with that lock token, then this request could succeed, both because the If header evaluates2005 token' precondition). 403 (Forbidden) - The currently authenticated principal does not have permission totrue, and because the lock token forremove the lockaffecting(the server SHOULD use theaffected'need- privileges' precondition element). 412 (Precondition Failed) - The resourcehas been provided. Alternatively, a request wherewas not locked. 8.12.2 Example >>Request UNLOCK /workspace/webdav/info.doc HTTP/1.1 Host: example.com Lock-Token: <opaquelocktoken:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7> Authorization: Digest username="ejw", realm="ejw@example.com", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..." >>Response HTTP/1.1 204 No Content In this example, the'rfc2518.txt' URL is associated withlock identified by the lock tokenin"opaquelocktoken:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7" is successfully removed from the resource http://example.com/workspace/webdav/info.doc. Ifheader could also succeed. 9.5.5 If Header and Non-DAV Aware Proxies Non-DAV aware proxies will not honorthis lock included more than just one resource, theIf header, since they will not understandlock is removed from all resources included in theIf header,lock. The 204 (No Content) status code is used instead of 200 (OK) because there is no response entity body. In this example, the nonce, response, and opaque fields have not been calculated in the Authorization request header. Dusseault & Crawford Expires January 16, 2006 [Page 62] Internet-Draft RFC2518bis July 2005 9. HTTPrequires non-understoodHeaders for Distributed Authoring All DAV headersto be ignored. When communicating with HTTP/1.1 proxies,follow the"Cache-Control: no-cache" request header MUST be used sosame basic formatting rules as HTTP headers. This includes rules like line continuation and how toprevent the proxy from improperly trying to service the request from its cache. When dealing with HTTP/1.0 proxies the "Pragma: no- cache" request header MUST be used forcombine (or separate) multiple instances of the samereason. 9.6 Lock-Tokenheader using commas. 9.1 DAV HeaderLock-TokenDAV ="Lock-Token""DAV" ":" #( compliance-code ) compliance-code = ( "1" | "2" | "bis" | extend ) extend = Coded-URLThe Lock-Token request header is used with the UNLOCK method to identify the lock to be removed. The lock| token This general-header appearing in theLock-Token request header MUST identify a lockresponse indicates thatcontainsthe resourceidentified by Request-URIsupports the DAV schema and protocol asa member. The Lock-Token responsespecified. All DAV compliant resources MUST return the DAV header on all OPTIONS responses. The value isused with the LOCK method to indicate the lock token created asaresultcomma-separated list ofa successful LOCK request to create a new lock. 9.7 Overwrite Header Overwrite = "Overwrite" ":" ("T" | "F") The Overwrite request header specifies whether the server should overwriteall compliance class identifiers that thestate of a non-null destinationresourceduring a COPYsupports. Class identifiers may be Coded-URLs orMOVE. A value of "F" statestokens (as defined by [RFC2616]). Identifiers can appear in any order. Identifiers that are standardized through theserverIETF RFC process are tokens, but other identifiers SHOULD be Coded- URLs to encourage uniqueness. A resource mustnot perform the COPY or MOVE operationshow class 1 compliance ifthe state of the destination resource is non-null. If the overwrite header isit shows class 2 or "bis" compliance. In general, support for one compliance class does notincludedentail support for any other. Please refer to section 16 for more details on compliance classes defined ina COPY or MOVE request then the resource MUST treatthis specification. This header must also appear on responses to OPTIONS requests to therequestspecial '*' Request-URI asifdefined in HTTP/1.1. In this case ithas an overwrite header of value "T". While the Overwrite header appears to duplicatemeans that thefunctionality ofrepository supports theIf-Match: *named features in at least some internal namespaces. As an optional request header, this headerof HTTP/1.1, If-Match applies only toallows theRequest-URI, and notclient tothe Destination of a COPYadvertise compliance with named features. Clients need not advertise 1, 2 orMOVE. Ifbis because aCOPY or MOVE is not performed dueWebDAV server currently doesn't need that information to decide how to respond to requests defined in this specification or in HTTP/1.1. However, future extensions may define client compliance codes. When used as a request header, thevalue of the Overwrite header, the method MUST fail with a 412 (Precondition Failed) status code. Dusseault & Crawford Expires January 15, 2005 [Page 63] Internet-Draft RFC2518bis July 2004 All DAV compliant resources MUST support the Overwrite header. 9.8 Timeout RequestDAV header MAY affect caching so this header SHOULD NOT be used on all GET requests. 9.2 Depth HeaderTimeOutDepth ="Timeout""Depth" ":"1#TimeType TimeType = ("Second-" DAVTimeOutVal("0" |"Infinite") DAVTimeOutVal = 1*digit Clients may include Timeout"1" | "infinity") Dusseault & Crawford Expires January 16, 2006 [Page 63] Internet-Draft RFC2518bis July 2005 The Depth requestheaders in their LOCK requests. However,header is used with methods executed on resources which could potentially have internal members to indicate whether theservermethod isnot requiredtohonorbe applied only to the resource ("Depth: 0"), to the resource and its immediate children, ("Depth: 1"), oreven consider these requests. Clients MUST NOT submit a Timeout requestthe resource and all its progeny ("Depth: infinity"). The Depth headerwith any method other than a LOCK method. Timeout response values MUST useis only supported if aSecond value or Infinite.method's definition explicitly provides for such support. The"Second" TimeType specifiesfollowing rules are thenumber of secondsdefault behavior for any method thatwill elapse between granting ofsupports thelock atDepth header. A method may override these defaults by defining different behavior in its definition. Methods which support theserver,Depth header may choose not to support all of the header's values and may define, on a case by case basis, theautomatic removalbehavior of thelock. The timeout value for TimeType "Second" MUST NOT be greater than 2^32-1. The timeout counter MUST be restartedmethod if arefresh LOCK requestDepth header issuccessful. The timeout counter SHOULD NOT be restarted at any other time. If the timeout expires thennot present. For example, thelock may be lost. Specifically,MOVE method only supports "Depth: infinity" and ifthe server wishes to harvest the lock upon time-out, the server SHOULDa Depth header is not present will act as ifan UNLOCK method was executed by the servera "Depth: infinity" header had been applied. Clients MUST NOT rely upon methods executing onthe resource using the lock tokenmembers of their hierarchies in any particular order or on thetimed-out lock, performed with its override authority. Thus logs should be updated withexecution being atomic unless thedispositionparticular method explicitly provides such guarantees. Upon execution, a method with a Depth header will perform as much ofthe lock, notifications should be sent, etc., justits assigned task asthey would bepossible and then return a response specifying what it was able to accomplish and what it failed to do. So, for example, anUNLOCK request. Servers are advised to pay close attentionattempt to COPY a hierarchy may result in some of thevalues submitted by clients, as they willmembers being copied and some not. Any headers on a method that has a defined interaction with the Depth header MUST beindicative ofapplied to all resources in thetypescope ofactivitytheclient intends to perform.method except where alternative behavior is explicitly defined. For example, anapplet running in a browser may needIf-Match header will have its value applied against every resource in the method's scope and will cause the method tolockfail if the header fails to match. If a resource,but because of the instability of the environmentsource or destination, withinwhichtheapplet is running,scope of theapplet may be turned off without warning. Asmethod with aresult, the appletDepth header islikely to ask forlocked in such arelatively small timeout value so that ifway as to prevent theapplet dies,successful execution of the method, then the lockcan be quickly harvested. However, a document management system is likely to asktoken foran extremely long timeout because its user may be planning on going off-line. A client MUST NOT assumethatjust becauseresource MUST be submitted with thetime-out has expiredrequest in thelock has been lost. Likewise, a client MUST NOT assume that just becauseIf request header. The Depth header only specifies thetime-out hasbehavior of the method with regards to internal children. If a resource does notexpired,have internal children then thelock still exists (and for this reason, clients are strongly advisedDepth header MUST be ignored. Please note, however, that it is always an error touse ETags as well).submit a value Dusseault & Crawford Expires January15, 200516, 2006 [Page 64] Internet-Draft RFC2518bis July2004 10. Status Code Extensions to HTTP/1.1 The following status codes are added to those defined in HTTP/1.1 RFC2616 [8]. 10.1 102 Processing The 102 (Processing) status code is an interim response used to inform2005 for theclientDepth header thatthe server has accepted the complete request, but hasis notyet completed it. This status code SHOULD only be sent whenallowed by theserver hasmethod's definition. Thus submitting areasonable expectation that"Depth: 1" on a COPY, even if therequestresource does not have internal members, willtake significant time to complete. As guidance, ifresult in a 400 (Bad Request). The methodis taking longer than 20 seconds (a reasonable,should fail not because the resource doesn't have internal members, butarbitrary value) to processbecause of theserver SHOULD return a 102 (Processing) response. The server MUST send a final response afterillegal value in the header. 9.3 Destination Header Destination = "Destination" ":" ( absoluteURI ) The Destination requesthas been completed. Methods can potentially takeheader specifies the URI which identifies along period of time to process, especiallydestination resource for methods such as COPY and MOVE, which take two URIs as parameters. Note thatsupporttheDepth header. In such casesabsoluteURI production is defined in RFC2396 [5]. If theclientDestination value is an absolute URI, it maytime-out the connection while waiting forname aresponse. To prevent thisdifferent server (or different port or scheme). If the source servermay returncannot attempt a102 (Processing) status codecopy toindicatethe remote server, it MUST fail the request with a 502 (Bad Gateway) response. Servers MAY attempt to copy theclient thatresource to the remote server using PUT/PROPPATCH or another mechanism. 9.4 Force-Authentication Header Force-Authentication = "Force-Authentication" ":" Method The Force-Authentication request header isstill processingused with themethod. 10.2 207 Multi-Status The 207 (Multi-Status) status code provides status for multiple independent operations (see Section 12 for more information). 10.3 422 Unprocessable Entity The 422 (Unprocessable Entity) status code meansOPTIONS method to specify that theserver understandsclient wants to be challenged for authentication credentials to thecontent type ofresource identified by therequest entity (henceRequest- URI. If present on a415(Unsupported Media Type) status code is inappropriate), and the syntax of therequestentity is correct (thusto a400 (Bad Request)WebDAV-compliant resource, the server MUST respond with either 401 (Unauthorized) or 501 (Not Implemented) statuscodecode. The Method value isinappropriate) but was unable to processused for thecontained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous XML instructions. 10.4 423 Locked The 423 (Locked) status code meansclient to indicate what method it intends to use first on thesource or destinationresourceof a methodidentified in the Request-URI. 9.5 If Header If = "If" ":" ( 1*No-tag-list | 1*Tagged-list) No-tag-list = List Tagged-list = Resource 1*List Resource = Coded-URL List = #( "(" List | Clause ")" ) Clause = ["Not"] State-token | State-token State-token = Coded-URL | "[" entity-tag "]" Coded-URL = "<" absoluteURI ">" The If request header islocked. This response SHOULD containintended to have similar functionality to the'missing-lock-token' element and corresponding hrefIf-Match header defined in section 14.24 of RFC2616 [7]. However theerror body.If header is intended for use with any URI which represents state Dusseault & Crawford Expires January15, 200516, 2006 [Page 65] Internet-Draft RFC2518bis July2004 10.5 424 Failed Dependency The 424 (Failed Dependency) status code means that the method could not be performed on the resource because the requested action depended on another action2005 information, referred to as a state token, about a resource as well as ETags. A typical example of a state token is a lock token, andthat action failed. For example, iflock tokens are the only state tokens defined in this specification. The <DAV:no-lock> state token is acommandspecial token that must never match an actual valid lock token. The purpose of this is described in section 9.5.5. The If header's purpose is to describe aPROPPATCH method fails then, at minimum,series of state lists. If thereststate of thecommands will alsoresource to which the header is applied does not match any of the specified state lists then the request MUST fail with424 (Failed Dependency). 10.6 507 Insufficient Storage The 507 (Insufficient Storage) status code meansa 412 (Precondition Failed). If one of themethod could not be performed ondescribed state lists matches the state of the resourcebecausethen the request may succeed. The serveris unable to storemust parse therepresentation neededIf header when it appears on any request, evaluate all the clauses, and if the conditional evaluates tosuccessfully completefalse, fail the request.This conditionNote that the absoluteURI production isconsidered to be temporary. Ifdefined in RFC2396 [5]. RFC2518 originally defined therequest which received this status code wasIf header without comma separators. This oversight meant that theresult of a user action,If header couldn't be divided up among multiple lines according to therequestHTTP header manipulation rules. Servers supporting "bis" MUSTNOTberepeated until it is requested by a separate user action. Dusseault & Crawford Expires January 15, 2005 [Page 66] Internet-Draft RFC2518bis July 2004 11. Use of HTTP Status Codes 11.1 301 Moved Permanently Any WebDAV request may be redirected using this status code. 11.2 302 Found Any WebDAV request may be redirected using this status code. 11.3 400 Bad Request This code may be used if: oable to accept commas in If header values. If theHostheaderis missing in any request o The protocol version is HTTP/1.0 o Anyhas commas between tokens or clauses, the headeris improperly formatted o The request method line is improperly formatted 11.4 403 Forbidden Tocan beused ifevaluated simply by removing theserver does not ever accept this method on this kind of resource. For example, if a PUT is not accepted on a collection. 11.5 409 Conflictcommas and proceeding with the evaluation rules. 9.5.1 No-tag-list Production The409 Conflict is most typically returned whenNo-tag-list production describes a series of state tokens and ETags. If multiple No-tag-list productions are used then one only needs to match the state of the resource for the methodthat attemptstocreate a newbe allowed to continue. All untagged tokens apply to the resourcemust fail, because one ofidentified in thecollectionsRequest-URI. Example - no-tag-list production If: (<opaquelocktoken:a-write-lock-token> ["I am an ETag"]), (["I am another ETag"]) The previous header would require that the resourcedepends on does not exist. However, other types of conflicts are definedidentified inspecifications extending RFC2518. Therefore, this canthe Request-URI bereturnedlocked with the specified lock token and inresponse to all methods. 11.6 414 Request-URI Too Long This status code is used in HTTP 1.1 only for Request-URIs, because full URIs arenȡt used in other headers. WebDAV specifies full URLs in other headers, therefore this error may be used iftheURI is too longstate identified by the "I am an ETag" ETag or inother locationsthe state identified by the second ETag "I am another ETag". To put the matter more plainly one can think of the previous If header aswell. This status code may be used in response to any methodbeing inthis specification.the form (or (and <opaquelocktoken:a-write-lock-token> ["I am an ETag"]) (and ["I am another ETag"])). Dusseault & Crawford Expires January15, 200516, 2006 [Page67]66] Internet-Draft RFC2518bis July2004 12. Multi-Status Response2005 9.5.2 Tagged-list Production Thedefault 207 (Multi-Status) response body is a text/xml or application/xml HTTP entity that contains a single XML element called multistatus, which contains a settagged-list production may be used instead ofXML elements called response which contain 200, 300, 400, and 500 series status codes generated duringthemethod invocation. 100 series status codes SHOULD NOT be recordedno-tag-list production, in order to scope each token to aresponse XML element. The 207 status code itself MUST NOT be considered a success response,specific resource. That is, itisspecifies that the lists following the resource specification onlycompletely successful if all response elements inside contain success status codes.apply to the specified resource. Thebodyscope ofa 207 Multi-Status response MUST contain a URL associated with each specific status code, so that the client can tell whethertheerror occurredresource production begins with thesource resource, destinationlist production immediately following the resourceor some otherproduction and ends with the next resource production, if any. All clauses must be evaluated. If the state of the resource named in thescopetag does not match any of therequest. URLs for collections appearingassociated state lists then the request MUST fail with a 412 (Precondition Failed). The tagged-list production MUST NOT be used together with the no-tag-list production, either in theresults SHOULD endsame If header or in a'/' character. When a Multi-Status body is returnedcontinuation. The same URI MUST NOT appear more than once inresponse to a PROPFIND or another request withasingle scope, all URLs appearingresource production in an If header. Example - Tagged List If header COPY /resource1 HTTP/1.1 Host: www.example.com Destination: http://www.example.com/resource2 If: <http://www.example.com/resource1> (<locktoken:a-write-lock- token> [W/"A weak ETag"]), (["strong ETag"]), <http://www.bar.bar/random>(["another strong ETag"]) In this example http://www.example.com/resource1 is being copied to http://www.example.com/resource2. When thebodymethod is first applied to http://www.example.com/resource1, resource1 must beequal to or inside the request-URI, thusin theURLs MAYstate specified by "(<locktoken:a-write-lock-token> [W/"A weak ETag"]) (["strong ETag"])", that is, it either must beabsolutelocked with a lock token of "locktoken:a-write-lock-token" and have a weak entity tag W/"A weak ETag" orMAY be relative. o If the URLs are absolute, then the server MUST ensure that the URLsit must have a strong entity tag "strong ETag". That is thesame prefix (scheme, host, port, and path) as the URL ofonly success condition since therequestedresource(which may behttp://www.bar.bar/random never has thesame asmethod applied to it (the only other resource listed in theRequest-URI or may be the correctedIf header) and http://www.example.com/resource2 is not listed in theresponse Location header). oIfthe URLs are relative, they MUST be resolved against the Location header, if present,header. 9.5.3 Not Production Every state token oras second choice againstETag is either current, and hence describes theRequest-URI. Whenstate of aMulti-Status body is returned in response to MOVEresource, orCOPY, relative URIs resolutionisambiguous (the request had both a sourcenot current, anda destination URL). Thus, URLs appearing indoes not describe theresponses to MOVE or COPY SHOULD be absolute and fully-qualified URLs. 12.1 Responses requiring Location in Multi-Statusstate of a resource. The300-303, 305 and 307 responses defined in HTTP 1.1 normally takeboolean operation of matching aLocation headerstate token or ETag toindicate where the client should make the request. The Multi-Status response syntax as defined in RFC2518 did not allow fortheLocation header information to be included in an unambiguous way, so servers MAY choose notcurrent state of a resource thus resolves touse these status codes in Multi-Status responses. Ifaclients receives this status code in Multi-Status, the client MAY reissue the requesttrue or false value. The "Not" production is used tothe individual resource, soreverse that value. The scope of theserver can issue a response with a Location header for each resource.not production is the state-token or entity-tag Dusseault & Crawford Expires January15, 200516, 2006 [Page68]67] Internet-Draft RFC2518bis July2004 Additionally, this specification defines2005 immediately following it. If: (Not <locktoken:write1> <locktoken:write2>) When submitted with anew elementrequest, this If header requires thatservers MAY use in the response element to provide a location value in Multi-Status (see Section 13.29). Dusseault & Crawford Expires January 15, 2005 [Page 69] Internet-Draft RFC2518bis July 2004 13. XML Element Definitions In this section, the final line of each section gives the element type declaration using the format defined in XML [11].all operand resources must not be locked with locktoken:write1 and must be locked with locktoken:write2. The"Value" field, where present, specifies further restrictions onNot production is particularly useful with theallowable contents of"<DAV:no-lock>" state token. The clause "Not <DAV:no-lock>" must evaluate to true. Thus, any "OR" statement containing theXML element using BNF (i.e.,clause "Not <DAV:no-lock>" must also evaluate tofurther restricttrue. 9.5.4 Matching Function When performing If header processing, thevaluesdefinition of aPCDATA element).matching state token or entity tag is as follows. Identifying a resource: The"Extensibility" field discusses howresource is identified by theelement may be extendedURI along with the token, in tagged list production, or by thefuture (orRequest-URI inexisting extensions to WebDAV. All ofuntagged list production. Matching entity tag: Where theelements defined here may be extended byentity tag matches an entity tag associated with theaddition of attributes and child elements not definedidentified resource. Matching state token: Where there is an exact match between the state token inthis specification. 13.1 activelock XML Element Name: activelock Namespace: DAV: Purpose: Describes a lockthe If header and any state token onathe identified resource.Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT activelock (lockscope, locktype, depth, owner?, timeout?, locktoken?, lockroot)> 13.2 depth XML Element Name: depth Namespace: DAV: Purpose: The valueA lock state token is considered to match if the resource is anywhere in the scope of theDepth header. Value: "0" | "1" | "infinity" Extensibility: MAY be extendedlock. Example - Matching lock tokens withattributes which SHOULD be ignored. <!ELEMENT depth (#PCDATA) > 13.3 locktoken XML Element Name: locktoken Namespace: DAV: Purpose: Thecollection locks DELETE /specs/rfc2518.txt HTTP/1.1 Host: www.example.com If: <http://www.example.com/specs/> (<locktoken:a-write-lock-token>) For this example, the lock tokenassociated withmust be compared to the identified resource, which is the 'specs' collection identified by the URL in the tagged list production. If the 'specs' collection is not locked or has alock. Description: The href containslock with asingledifferent token, the request MUST fail. If the 'specs' collection is locked (depth infinity) with that locktoken URI which referstoken, then this request could succeed, both because the If header evaluates to true, and because the lock(i.e.,token for theOpaqueLockToken-URI production in section 6.4). Extensibility: MAY be extendedlock affecting the affected resource has been provided. Alternatively, a request where the 'rfc2518.txt' URL is associated withadditional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT locktoken (href) >the lock token in the If header could also succeed. Dusseault & Crawford Expires January15, 200516, 2006 [Page70]68] Internet-Draft RFC2518bis July2004 13.4 lockroot XML Element Name: lockroot Namespace: DAV: Purpose: Contains the root URL of2005 9.5.5 If Header and Non-DAV Aware Proxies Non-DAV aware proxies will not honor thelock, which isIf header, since they will not understand theURL through whichIf header, and HTTP requires non-understood headers to be ignored. When communicating with HTTP/1.1 proxies, theresource was addressed in"Cache-Control: no-cache" request header MUST be used so as to prevent theLOCK request. Description: The href contains a URL withproxy from improperly trying to service theaddress ofrequest from its cache. When dealing with HTTP/1.0 proxies theroot of"Pragma: no- cache" request header MUST be used for thelock.same reason. 9.6 Lock-Token Header Lock-Token = "Lock-Token" ":" Coded-URL Theserver SHOULD include this in all lockdiscovery property values andLock-Token request header is used with theresponseUNLOCK method to identify the lock toLOCK requests. Extensibility: MAY be extended with additional child elements or attributes which SHOULDbeignored if not recognized. <!ELEMENT lockroot (href) > 13.5 timeout XML Element Name: timeout Namespace: DAV: Purpose:removed. Thenumber of seconds remaining before alockexpires. Value: TimeType (definedtoken inSection 9.8). Extensibility: MAY be extended with attributes which SHOULD be ignored. <!ELEMENT timeout (#PCDATA) > 13.6 collection XML Element Name: collection Namespace: DAV: Purpose: IdentifiestheassociatedLock-Token request header MUST identify a lock that contains the resource identified by Request-URI as acollection.member. Theresourcetype property of a collection resource MUST contain this element. ItLock-Token response header isnormally empty but extensions may add sub-elements. Extensibility: MAY be extendedused withchild elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT collection EMPTY > 13.7 href XML Element Name: href Namespace: DAV: Purpose: Identifiesthecontent ofLOCK method to indicate theelementlock token created as aURI. In many situations, this URI MUST be a HTTP URI, and furthermore, it MUST identifyresult of aWebDAV resource. There is one exceptionsuccessful LOCK request tothis general rule increate a new lock. 9.7 Overwrite Header Overwrite = "Overwrite" ":" ("T" | "F") The Overwrite request header specifies whether thelockdiscovery property, whereserver should overwrite thelock token (whichstate of a non-null destination resource during a COPY or MOVE. A value of "F" states that the server must not perform the COPY or MOVE operation if the state of the destination resource is non-null. If the overwrite header is not included in aURI but mayCOPY or MOVE request then the resource MUST treat the request as if it has an overwrite header of value "T". While the Overwrite header appears to duplicate the functionality of the If-Match: * header of HTTP/1.1, If-Match applies only to the Request-URI, and notbeto the Destination of aHTTP URI)COPY or MOVE. If a COPY or MOVE isinsidenot performed due to thehref element. Other specifications SHOULD be explicit ifvalue of thehrefOverwrite header, the method MUST fail with a 412 (Precondition Failed) status code. All DAV compliant resources MUST support the Overwrite header. 9.8 Timeout Request Header TimeOut = "Timeout" ":" 1#TimeType TimeType = ("Second-" DAVTimeOutVal | "Infinite") Dusseault & Crawford Expires January15, 200516, 2006 [Page71]69] Internet-Draft RFC2518bis July2004 element2005 DAVTimeOutVal = 1*digit Clients may include Timeout request headers in their LOCK requests. However, the server is not required tocontain non-HTTP URIs. Value: URI (See section 3.2.1 of RFC2616 [8]) Extensibility: MAY be extended with attributes which SHOULD be ignored. <!ELEMENT href (#PCDATA)> 13.8 lockentry XML Element Name: lockentry Namespace: DAV: Purpose: Defineshonor or even consider these requests. Clients MUST NOT submit a Timeout request header with any method other than a LOCK method. Timeout response values MUST use a Second value or Infinite. The "Second" TimeType specifies thetypesnumber oflocksseconds thatcan be used withwill elapse between granting of theresource. Extensibility: MAYlock at the server, and the automatic removal of the lock. The timeout value for TimeType "Second" MUST NOT beextended with additional child elements or attributes which SHOULDgreater than 2^32-1. The timeout counter MUST beignoredrestarted ifnot recognized. <!ELEMENT lockentry (lockscope, locktype) > 13.9 lockinfo XML Element Name: lockinfo Namespace: DAV: Purpose: The lockinfo XML element is used witha refresh LOCKmethod to specifyrequest is successful. The timeout counter SHOULD NOT be restarted at any other time. If the timeout expires then thetype oflock may be lost. Specifically, if theclientserver wishes tohave created. Extensibility: MAY be extended with additional child elements or attributes whichharvest the lock upon time-out, the server SHOULDbe ignoredact as ifnot recognized. <!ELEMENT lockinfo (lockscope, locktype, owner?) > 13.10 lockscope XML Element Name: lockscope Namespace: DAV: Purpose: Specifies whether a lock isanexclusiveUNLOCK method was executed by the server on the resource using the lock token of the timed-out lock,or a shared lock. Extensibility: SHOULD NOT be extendedperformed withchild elements. MAYits override authority. Thus logs should beextendedupdated withattributes which SHOULDthe disposition of the lock, notifications should beignored. <!ELEMENT lockscope (exclusive | shared) > 13.11 exclusive XML Element Name: exclusive Namespace: DAV: Purpose: Specifies an exclusive lock Dusseault & Crawford Expires January 15, 2005 [Page 72] Internet-Draft RFC2518bis July 2004 Extensibility: Normally empty, but MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT exclusive EMPTY > 13.12 shared XML Element Name: shared Namespace: DAV: Purpose: Specifies a shared lock Extensibility: Normally empty, but MAYsent, etc., just as they would beextended with additional child elements or attributes which SHOULDfor an UNLOCK request. Servers are advised to pay close attention to the values submitted by clients, as they will beignored if not recognized. <!ELEMENT shared EMPTY > 13.13 locktype XML Element Name: locktype Namespace: DAV: Purpose: Specifiesindicative of theaccesstype of activity the client intends to perform. For example, an applet running in alock. At present, this specification only defines onebrowser may need to locktype, the write lock. Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT locktype (write) > 13.14 write XML Element Name: write Namespace: DAV: Purpose: Specifiesawrite lock. Extensibility: Normally empty,resource, butMAY be extended with additional child elements or attributesbecause of the instability of the environment within whichSHOULDthe applet is running, the applet may beignored if not recognized. <!ELEMENT write EMPTY > 13.15 multistatus XML Element Name: multistatus Namespace: DAV: Purpose: Contains multiple response messages. Description The responsedescription atturned off without warning. As a result, thetop levelapplet isusedlikely toprovideask for ageneral message describingrelatively small timeout value so that if theoverarching nature ofapplet dies, theresponse. If this valuelock can be quickly harvested. However, a document management system isavailablelikely to ask for anapplicationextremely long timeout because its user mayuse it instead of presentingbe planning on going off-line. A client MUST NOT assume that just because theindividual response descriptionstime-out has expired the lock has been lost. Likewise, a client MUST NOT assume that just because the time-out has not expired, the lock still exists (and for this reason, clients are strongly advised to use ETags as well). Dusseault & Crawford Expires January15, 200516, 2006 [Page73]70] Internet-Draft RFC2518bis July2004 contained within2005 10. Status Code Extensions to HTTP/1.1 The following status codes are added to those defined in HTTP/1.1 RFC2616 [7]. 10.1 102 Processing The 102 (Processing) status code is an interim response used to inform theresponses. Extensibility: MAY be extended with additional child elements or attributes whichclient that the server has accepted the complete request, but has not yet completed it. This status code SHOULD only beignored if not recognized. <!ELEMENT multistatus (response+, responsedescription?) > 13.16 response XML Element Name: locktype Namespace: DAV: Purpose: Holdssent when the server has asingle response describingreasonable expectation that theeffect ofrequest will take significant time to complete. As guidance, if a methodon resource and/or its properties. Description: A particular href MUST NOT appear moreis taking longer thanonce as20 seconds (a reasonable, but arbitrary value) to process thechild ofserver SHOULD return a 102 (Processing) response. The server MUST send a final responseXML element underafter the request has been completed. Methods can potentially take amultistatus XML element. This requirement is necessary in orderlong period of time tokeep processing costsprocess, especially methods that support the Depth header. In such cases the client may time-out the connection while waiting for aresponse to linear time. Essentially,response. To prevent thisprevents having to search in order to group together alltheresponses by href. There are, however, no requirements regarding ordering based on href values. Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT response (href, ((href*, status)|(propstat+)), responsedescription? , location?) > 13.17 propstat XML Element Name: propstat Namespace: DAV: Purpose: Groups togetherserver may return aprop and102 (Processing) statuselementcode to indicate to the client that the server isassociated with a particular href element. Description:still processing the method. 10.2 207 Multi-Status Thepropstat XML element MUST contain one prop XML element and one207 (Multi-Status) statusXML element.code provides status for multiple independent operations (see Section 12 for more information). 10.3 422 Unprocessable Entity Thecontents of422 (Unprocessable Entity) status code means theprop XML element MUST only listserver understands thenamescontent type ofproperties to which the result inthe request entity (hence a 415(Unsupported Media Type) statuselement applies. Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT propstat (prop, status, responsedescription?) > 13.18code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) statusXML Element Name:code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous XML instructions. 10.4 423 Locked The 423 (Locked) statusNamespace: DAV: Purpose: Holdscode means the source or destination resource of asingle HTTP status-linemethod is locked. This response SHOULD contain the 'missing- lock-token' element and corresponding href in the error body. Dusseault & Crawford Expires January15, 200516, 2006 [Page74]71] Internet-Draft RFC2518bis July2004 Value: status-line (status-line defined in RFC2616 [8] Extensibility: MAY be extended with attributes which SHOULD be ignored. <!ELEMENT2005 10.5 424 Failed Dependency The 424 (Failed Dependency) status(#PCDATA) > 13.19 responsedescription XML Element Name: responsedescription Namespace: DAV: Purpose: Contains a messagecode means thatcanthe method could not bedisplayed toperformed on theuser explainingresource because thenaturerequested action depended on another action and that action failed. For example, if a command in a PROPPATCH method fails then, at minimum, the rest of theresponse. Description: This XML element provides information suitable tocommands will also fail with 424 (Failed Dependency). 10.6 507 Insufficient Storage The 507 (Insufficient Storage) status code means the method could not bepresentedperformed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered toa user. Extensibility: MAYbeextended with attributestemporary. If the request whichSHOULD be ignored. <!ELEMENT responsedescription (#PCDATA) > 13.20 owner XML Element Name: owner Namespace: DAV: Purpose: Provides information aboutreceived this status code was theprincipal taking outresult of alock. Description The owner XML element provides information sufficient for either directly contacting a principal (such as a telephone number or Email URI), or for discovering the principal (such as the URL of a homepage) who owns a lock. This information is provided by the client, and may only be altered by the server if the owner value provided byuser action, theclient is empty. Extensibility MAY be extended with child elements, mixed content, text content or attributes. Structured content, for example one or more <href> child elements containing URLs, is RECOMMENDED. <!ELEMENT owner ANY 13.21 prop XML element Name: prop Namespace: DAV: Purpose: Contains properties related to a resource. Description The prop XML element is a generic container for properties defined on resources. All elements inside a prop XML elementrequest MUSTdefine properties related to the resource. No other elements mayNOT beused inside ofrepeated until it is requested by aprop element.separate user action. Dusseault & Crawford Expires January15, 200516, 2006 [Page75]72] Internet-Draft RFC2518bis July2004 Extensibility MAY be extended with attributes which SHOULD be ignored if not recognized. Any child element2005 11. Use of HTTP Status Codes These HTTP codes are not redefined, but thiselement mustsection serves as a reminder that these HTTP codes may beconsideredused in responses to WebDAV methods and clients must bea property name, however these are not restrictedappropriately prepared tothe property names defined in this document or other standards. <!ELEMENT prop ANY 13.22 propertyupdate XML element Name: propertyupdate Namespace: DAV: Purpose: Contains ahandle them. 11.1 301 Moved Permanently Any WebDAV requestto alter the properties on a resource. Description: This XML element is a container for the information required to modify the properties on the resource. This XML element is multi-valued. Extensibility: MAYmay beextended with additional child elements or attributes which SHOULDredirected using this status code. 11.2 302 Found Any WebDAV request may beignored if not recognized. <!ELEMENT propertyupdate (remove | set)+ > 13.23 remove XML element Name: remove Namespace: DAV: Purpose: Lists the DAV properties toredirected using this status code. 11.3 400 Bad Request This code may beremoved from a resource. Description: Remove instructs thatused if: o theproperties specifiedHost header is missing inprop shouldany request o The protocol version is HTTP/1.0 o Any header is improperly formatted o The request method line is improperly formatted 11.4 403 Forbidden To beremoved. Specifyingused if theremoval of a property thatserver does notexistever accept this method on this kind of resource. For example, if a PUT is notan error. All the XML elements inaccepted on aprop XML element inside ofcollection. 11.5 409 Conflict The 409 Conflict is most typically returned when aremove XML element MUST be empty, as onlymethod that attempts to create a new resource must fail, because one of thenamescollections that resource depends on does not exist. However, other types ofproperties to be removedconflicts arerequired. Extensibility: MAYdefined in specifications extending RFC2518. Therefore, this can beextended with additional child elementsreturned in response to all methods. 11.6 412 Precondition Failed Any request may contain a conditional header defined in HTTP (If- Match, If-Modified-Since, etc.) orattributes which SHOULD be ignored if not recognized. <!ELEMENT remove (prop) > 13.24 set XML element Name: set Namespace: DAV: Purpose: Lists the DAV property values to be set for a resource. Description: The set XML element MUST contain only a prop XML element. The elements contained by the prop XML element insidetheset XML element MUST specify"If" conditional header defined in this specification. If thenamerequest contains a conditional header, andvalue of propertiesif thatare set on the resource identified by Request-URI. If a property already existscondition fails to hold, thenits valuethis error code may be returned. This status code isreplaced. Language tagging information appearing in the scope of the prop element (in the "xml:lang" attribute,not typically appropriate ifpresent) MUST be persistently stored along withtheproperty, and MUST be subsequently retrievableDusseault & Crawford Expires January15, 200516, 2006 [Page76]73] Internet-Draft RFC2518bis July2004 using PROPFIND. Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if2005 client did notrecognized. <!ELEMENT set (prop) > 13.25 propfind XML Element Name: propfind Namespace: DAV: Purpose: Specifies the properties to be returned frominclude aPROPFIND method. Four special elements are specified for use with propfind: prop, dead-props, allprop and propname. If propconditional header in the request. 11.7 414 Request-URI Too Long This status code is usedinside propfind it MUST NOT contain property values. Extensibility: MAY be extended with additional child elements or attributes which SHOULDin HTTP 1.1 only for Request-URIs, because full URIs arenit used in other headers. WebDAV specifies full URLs in other headers, therefore this error may beignoredused ifnot recognized, asthe URI is too long in other locations asit still contains one of the required elements. <!ELEMENT propfind (prop | dead-props | propname | allprop) > 13.26 allprop XML Element Name: allprop Namespace: DAV: Purpose: The allprop XML element specifies that all names and values of dead properties and the live properties defined bywell. This status code may be used in response to any method in thisdocument existing on the resource arespecification. 11.8 503 Service Unavailable This status code is particularly useful tobe returned. Extensibility: Normally empty, but MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT allprop EMPTY > 13.27 propname XML Element Name: propname Namespace: DAV: Purpose: The propname XML element specifiesrespond to requests thatonly a list of property names ontheresource is to be returned. Extensibility: Normally empty, but MAY be extended with additional child elementsserver considers a denial-of-service attack, such as excessively large PROPFIND depth infinity requests orattributes which SHOULD be ignored if not recognized. <!ELEMENT propname EMPTY > 13.28 dead-props XML Elementrequests in quick succession. Dusseault & Crawford Expires January15, 200516, 2006 [Page77]74] Internet-Draft RFC2518bis July2004 Name: dead-props Namespace: DAV: Purpose:2005 12. Multi-Status Response Thedead-propsdefault 207 (Multi-Status) response body is a text/xml or application/xml HTTP entity that contains a single XML elementspecifies that all dead properties, namescalled multistatus, which contains a set of XML elements called response which contain 200, 300, 400, andvalues, should be returned in500 series status codes generated during theresponse. Extensibility: Normally empty, but MAYmethod invocation. 100 series status codes SHOULD NOT beextended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENT dead-props EMPTY > 13.29 locationrecorded in a response XMLElement Name: location Namespace: DAV: Purpose: In normal responses (not Multi-Status), someelement. The 207 statuscodes go along withcode itself MUST NOT be considered aLocation header. When thesesuccess response, it is only completely successful if all response elements inside contain success statuscodes are used incodes. The body of a 207 Multi-Statusresponse, this element is used instead. Description: Containsresponse MUST contain asingle href elementURL associated withthe same URIeach specific status code, so thatwould be used in a Location header. Extensibility: MAY be extendedthe client can tell whether the error occurred withadditional child elementsthe source resource, destination resource orattributes which SHOULD be ignored if not recognized. <!ELEMENT location (href) > 13.30 error XML Element Name: error Namespace: DAV: Purpose: Error responses, particularly 403 Forbidden and 409 Conflict, sometimes need more information to indicate what went wrong. When an error response contains a bodysome other resource inWebDAV,thebody isscope of the request. URLs for collections appearing inXML withtheroot element 'error'. The 'error' tagresults SHOULDincludeend in astandard error tag defined'/' character. When a Multi-Status body is returned inthis specificationresponse to a PROPFIND or anotherspecification. The 'error' tag MAY include custom error tags (in custom namespaces) which a client can safely ignore. Description: Contains any XML element Extensibility: Fully extensiblerequest withadditional child elementsa single scope, all URLs appearing in the body must be equal to orattributes which SHOULDinside the request-URI, thus the URLs MAY beignored if not recognized. <!ELEMENT error ANY > Dusseault & Crawford Expires January 15, 2005 [Page 78] Internet-Draft RFC2518bis July 2004 14. DAV Properties For DAV properties,absolute or MAY be relative. o If thename ofURLs are absolute, then theproperty is alsoserver MUST ensure that the URLs have the same prefix (scheme, host, port, and path) as thenameURL of theXML element that contains its value. In the section below,requested resource (which may be thefinal line of each section givessame as theelement type declaration usingRequest-URI or may be theformat definedcorrected inXML [11]. The "Value" field, where present, specifies further restrictions ontheallowable contents ofresponse Location header). o If theXML element using BNF (i.e., to further restrictURLs are relative, they MUST be resolved against thevalues of a PCDATA element). Note thatLocation header, if present, or as second choice against the Request-URI. When aresource may have only one value forMulti-Status body is returned in response to MOVE or COPY, relative URIs resolution is ambiguous (the request had both aproperty ofsource and agiven name, so the property may only show up oncedestination URL). Thus, URLs appearing inPROPFINDthe responses to MOVE orPROPPATCH requests. Some property values are calculated by the serverCOPY SHOULD be absolute andit is not appropriatefully-qualified URLs. 12.1 Responses requiring Location in Multi-Status The 300-303, 305 and 307 responses defined in HTTP 1.1 normally take a Location header toallowindicate where the clientchanges, thus they are protected. Existing server implementations already have different sets of RFC2518 properties protected, but clients can have some expectations which properties are normally protected.should make the request. Thevalue of a protected property mayMulti-Status response syntax as defined in RFC2518 did notbe changed even by a user with permissionallow for the Location header information toedit other properties. The value of an unprotected property maybechanged by some users with appropriate permissions. 14.1 creationdate Property Name: creationdate Namespace: DAV: Purpose: Records the time and date the resource was created. Value: date-time (defined in RFC3339 [9], see the ABNFincluded insection 5.6.) Protected: MAY be protected. Somean unambiguous way, so serversallow creationdate to be changedMAY choose not toreflectuse these status codes in Multi-Status responses. If a clients receives this status code in Multi-Status, thetimeclient MAY reissue thedocument was created if that is more meaningfulrequest to theuser (rather thanindividual resource, so that thetime it was uploaded). Thus, clients SHOULD NOT use this property in synchronization logic (use getetag instead). COPY/MOVE behaviour: This property value SHOULD be kept during a MOVE operation, but is normally re-initialized whenserver can issue aresource is createdresponse with aCOPY. It should not be set in a COPY. Description: The creationdate property should be defined on all DAV compliant resources. If present, it contains a timestamp of the moment when the resource was created (i.e., the moment it had non-null state). Extensibility: MAY contain attributes which SHOULD be ignored if not recognized. <!ELEMENT creationdate (#PCDATA) > 14.2 displayname PropertyLocation Dusseault & Crawford Expires January15, 200516, 2006 [Page79]75] Internet-Draft RFC2518bis July2004 Name: displayname Namespace: DAV: Purpose: Provides a name2005 header forthe resourceeach resource. Additionally, this specification defines a new element thatis suitable for presentationservers MAY use in the response element to provide auser. Value: Any text Protected: Possibly COPY/MOVE behaviour: This propertylocation valueSHOULD be preservedinlocal COPY and MOVE operations. It MAY be attempted to be setMulti- Status (see Section 13.29). Dusseault & Crawford Expires January 16, 2006 [Page 76] Internet-Draft RFC2518bis July 2005 13. XML Element Definitions In this section, the final line of each section gives the element type declaration using the format defined ina COPY operationXML [11]. The "Value" field, where present, specifies further restrictions on the allowable contents of the XML element using BNF (i.e., to further restrict the values of aremote server. Description:PCDATA element). Thedisplayname property should"Extensibility" field discusses how the element may bedefined on all DAV compliant resources. If present,extended in theproperty contains a descriptionfuture (or in existing extensions to WebDAV. All of theresource that is suitable for presentation toelements defined here may be extended by the addition of attributes and child elements not defined in this specification. 13.1 activelock XML Element Name: activelock Namespace: DAV: Purpose: Describes auser.lock on a resource. Extensibility: MAYcontainbe extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENTdisplayname (#PCDATA) > 14.3 getcontentlanguage Propertyactivelock (lockscope, locktype, depth, owner?, timeout?, locktoken?, lockroot)> 13.2 depth XML Element Name:getcontentlanguagedepth Namespace: DAV: Purpose:ContainsThe value of theContent-Language header returned by a GET without accept headersDepth header. Value:language-tag (language-tag is defined in section 14.13 of RFC2616 [8]) Protected: SHOULD NOT be protected, so that clients can reset the language. COPY/MOVE behaviour: This property value SHOULD be preserved in local COPY and MOVE operations. It SHOULD be attempted to be set in a COPY operation to a remote server. Description: The getcontentlanguage property MUST be defined on any DAV compliant resource that returns the Content-Language header on a GET."0" | "1" | "infinity" Extensibility: MAYcontainbe extended with attributes which SHOULD beignored if not recognized.ignored. <!ELEMENTgetcontentlanguagedepth (#PCDATA) >14.4 getcontentlength Property Name: getcontentlength Namespace: DAV: Purpose: Contains the Content-Length header returned by a GET without accept headers.13.3 locktoken XML Element Dusseault & Crawford Expires January15, 200516, 2006 [Page80]77] Internet-Draft RFC2518bis July2004 Value: content-length (see section 14.14 of RFC2616 [8]) Protected: SHOULD be protected so clients cannot set to misleading values2005 Name: locktoken Namespace: DAV: Purpose: The lock token associated with a lock. Description: Thegetcontentlength property MUST be defined on any DAV compliant resource that returns the Content-Length header in response tohref contains aGET. COPY/MOVE behaviour: This property value is dependent on the size of the destination resource, not the value ofsingle lock token URI which refers to theproperty onlock (i.e., thesource resource.OpaqueLockToken-URI production in section 6.4). Extensibility: MAYcontainbe extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENTgetcontentlength (#PCDATA)locktoken (href) >14.5 getcontenttype Property13.4 lockroot XML Element Name:getcontenttypelockroot Namespace: DAV: Purpose: Contains theContent-Type header returned by a GET without accept headers. Value: media-type (defined in section 3.7root URL ofRFC2616 [8]) Protected: SHOULD NOT be protected, so clients may fix this value COPY/MOVE behaviour: This property value SHOULD be preserved in local COPY and MOVE operations. In a remote COPY operation thatthe lock, which isimplementedthe URL througha PUT request,which thePUT request must haveresource was addressed in theappropriate Content-Type header.LOCK request. Description:This getcontenttype property MUST be defined on any DAV compliant resource that returnsThe href contains a URL with theContent-Type headeraddress of the root of the lock. The server SHOULD include this in all lockdiscovery property values and the response toa GET.LOCK requests. Extensibility: MAYcontainbe extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENTgetcontenttype (#PCDATA)lockroot (href) >14.6 getetag Property13.5 timeout XML Element Name:getetagtimeout Namespace: DAV: Purpose:Contains the ETag header returned byThe number of seconds remaining before aGET without accept headers.lock expires. Value:entity-tagTimeType (defined insection 3.11 of RFC2616 [8]) Protected: MUSTSection 9.8). Extensibility: MAY beprotected because this value is created and controlled by the server. COPY/MOVE behaviour: This property value is dependent on the final state of the destination resource, not the value of the property on the source resource.extended with attributes which SHOULD be ignored. <!ELEMENT timeout (#PCDATA) > Dusseault & Crawford Expires January15, 200516, 2006 [Page81]78] Internet-Draft RFC2518bis July2004 Description: The getetag property MUST be defined on any DAV compliant resource that returns2005 13.6 collection XML Element Name: collection Namespace: DAV: Purpose: Identifies theEtag header. Refer to RFC2616 forassociated resource as acomplete definition of the semanticscollection. The resourcetype property ofan ETag. Note that changes in properties or lock state MUST not causearesourceȡs ETag to change.collection resource MUST contain this element. It is normally empty but extensions may add sub- elements. Extensibility: MAYcontain attributes whichbe extended with child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENTgetetag (#PCDATA)collection EMPTY >14.7 getlastmodified Property13.7 href XML Element Name:getlastmodifiedhref Namespace: DAV: Purpose:Contains the Last-Modified header returned by a GET method without accept headers. Value: HTTP-date (defined in section 3.3.1 of RFC2616 [8]) Protected: SHOULD be protected because some clients may rely on the value for appropriate caching behavior, or on the value of the Last-Modified header to which this property is linked. COPY/MOVE behaviour: This property value is dependent on the last modified date of the destination resource, notIdentifies thevaluecontent of theproperty on the source resource. Note that some server implementations use the file system date modified value for the 'getlastmodified' value, andelement as a URI. In many situations, thisis preserved inURI MUST be aMOVE even when theHTTPLast-Modified value SHOULD change. Thus, clients cannot rely on this value for cachingURI, andSHOULD use ETags. Description: Note that the last-modified date onfurthermore, it MUST identify aresource SHOULD only reflect changes in the body (the GET responses) of theWebDAV resource.A change in a property only SHOULD NOT cause the last-modified dateThere is one exception tochange, because clients MAY rely onthis general rule in thelast-modified date to know when to overwritelockdiscovery property, where theexisting body. The getlastmodified property MUSTlock token (which is a URI but may not bedefined on any DAV compliant resource that returns the Last- Modified header in response toaGET. Extensibility: MAY contain attributes whichHTTP URI) is inside the href element. Other specifications SHOULD beignoredexplicit ifnot recognized.the href element is to contain non-HTTP URIs. Value: URI (See section 3.2.1 of RFC2616 [7]) Extensibility: MAY be extended with attributes which SHOULD be ignored. <!ELEMENTgetlastmodified (#PCDATA) > 14.8 lockdiscovery Propertyhref (#PCDATA)> 13.8 lockentry XML Element Name:lockdiscoverylockentry Namespace: DAV:Purpose: Describes the active locks on a resourceDusseault & Crawford Expires January15, 200516, 2006 [Page82]79] Internet-Draft RFC2518bis July2004 Protected: MUST be protected. Clients change the list of locks through LOCK and UNLOCK, not through PROPPATCH. COPY/MOVE behaviour: The value of this property depends on2005 Purpose: Defines thelock statetypes ofthe destination, not on thelocksofthat can be used with thesourceresource.Recall that locks areExtensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if notmoved in a MOVE operation. Description:recognized. <!ELEMENT lockentry (lockscope, locktype) > 13.9 lockinfo XML Element Name: lockinfo Namespace: DAV: Purpose: Thelockdiscovery property returns a listing of who haslockinfo XML element is used with alock, what type of lock he has,LOCK method to specify thetimeouttypeand the time remaining on the timeout, and the associated lock token. If there are no locks, but the server supports locks, the property will be present but contain zero Ƚactivelockȡ elements. If there is one or more lock, an Ƚactivelockȡ element appears for eachof lockontheresource.client wishes to have created. Extensibility: MAY be extended with additional child elements or attributes which SHOULD be ignored if not recognized. <!ELEMENTlockdiscovery (activelock)*lockinfo (lockscope, locktype, owner?) >