1
2
3
4
5
6
7Network Working Group L. Dusseault, Ed.
8Request for Comments: 4918 CommerceNet
9Obsoletes: 2518 June 2007
10Category: Standards Track
11
12
13 HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)
14
15Status of This Memo
16
17 This document specifies an Internet standards track protocol for the
18 Internet community, and requests discussion and suggestions for
19 improvements. Please refer to the current edition of the "Internet
20 Official Protocol Standards" (STD 1) for the standardization state
21 and status of this protocol. Distribution of this memo is unlimited.
22
23Copyright Notice
24
25 Copyright (C) The IETF Trust (2007).
26
27Abstract
28
29 Web Distributed Authoring and Versioning (WebDAV) consists of a set
30 of methods, headers, and content-types ancillary to HTTP/1.1 for the
31 management of resource properties, creation and management of
32 resource collections, URL namespace manipulation, and resource
33 locking (collision avoidance).
34
35 RFC 2518 was published in February 1999, and this specification
36 obsoletes RFC 2518 with minor revisions mostly due to
37 interoperability experience.
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58Dusseault Standards Track [Page 1]
59
60RFC 4918 WebDAV June 2007
61
62
63Table of Contents
64
65 1. Introduction ....................................................7
66 2. Notational Conventions ..........................................8
67 3. Terminology .....................................................8
68 4. Data Model for Resource Properties .............................10
69 4.1. The Resource Property Model ...............................10
70 4.2. Properties and HTTP Headers ...............................10
71 4.3. Property Values ...........................................10
72 4.3.1. Example - Property with Mixed Content ..............12
73 4.4. Property Names ............................................14
74 4.5. Source Resources and Output Resources .....................14
75 5. Collections of Web Resources ...................................14
76 5.1. HTTP URL Namespace Model ..................................15
77 5.2. Collection Resources ......................................15
78 6. Locking ........................................................17
79 6.1. Lock Model ................................................18
80 6.2. Exclusive vs. Shared Locks ................................19
81 6.3. Required Support ..........................................20
82 6.4. Lock Creator and Privileges ...............................20
83 6.5. Lock Tokens ...............................................21
84 6.6. Lock Timeout ..............................................21
85 6.7. Lock Capability Discovery .................................22
86 6.8. Active Lock Discovery .....................................22
87 7. Write Lock .....................................................23
88 7.1. Write Locks and Properties ................................24
89 7.2. Avoiding Lost Updates .....................................24
90 7.3. Write Locks and Unmapped URLs .............................25
91 7.4. Write Locks and Collections ...............................26
92 7.5. Write Locks and the If Request Header .....................28
93 7.5.1. Example - Write Lock and COPY ......................28
94 7.5.2. Example - Deleting a Member of a Locked
95 Collection .........................................29
96 7.6. Write Locks and COPY/MOVE .................................30
97 7.7. Refreshing Write Locks ....................................30
98 8. General Request and Response Handling ..........................31
99 8.1. Precedence in Error Handling ..............................31
100 8.2. Use of XML ................................................31
101 8.3. URL Handling ..............................................32
102 8.3.1. Example - Correct URL Handling .....................32
103 8.4. Required Bodies in Requests ...............................33
104 8.5. HTTP Headers for Use in WebDAV ............................33
105 8.6. ETag ......................................................33
106 8.7. Including Error Response Bodies ...........................34
107 8.8. Impact of Namespace Operations on Cache Validators ........34
108 9. HTTP Methods for Distributed Authoring .........................35
109 9.1. PROPFIND Method ...........................................35
110 9.1.1. PROPFIND Status Codes ..............................37
111
112
113
114Dusseault Standards Track [Page 2]
115
116RFC 4918 WebDAV June 2007
117
118
119 9.1.2. Status Codes for Use in 'propstat' Element .........37
120 9.1.3. Example - Retrieving Named Properties ..............38
121 9.1.4. Example - Using 'propname' to Retrieve All
122 Property Names .....................................39
123 9.1.5. Example - Using So-called 'allprop' ................41
124 9.1.6. Example - Using 'allprop' with 'include' ...........43
125 9.2. PROPPATCH Method ..........................................44
126 9.2.1. Status Codes for Use in 'propstat' Element .........44
127 9.2.2. Example - PROPPATCH ................................45
128 9.3. MKCOL Method ..............................................46
129 9.3.1. MKCOL Status Codes .................................47
130 9.3.2. Example - MKCOL ....................................47
131 9.4. GET, HEAD for Collections .................................48
132 9.5. POST for Collections ......................................48
133 9.6. DELETE Requirements .......................................48
134 9.6.1. DELETE for Collections .............................49
135 9.6.2. Example - DELETE ...................................49
136 9.7. PUT Requirements ..........................................50
137 9.7.1. PUT for Non-Collection Resources ...................50
138 9.7.2. PUT for Collections ................................51
139 9.8. COPY Method ...............................................51
140 9.8.1. COPY for Non-collection Resources ..................51
141 9.8.2. COPY for Properties ................................52
142 9.8.3. COPY for Collections ...............................52
143 9.8.4. COPY and Overwriting Destination Resources .........53
144 9.8.5. Status Codes .......................................54
145 9.8.6. Example - COPY with Overwrite ......................55
146 9.8.7. Example - COPY with No Overwrite ...................55
147 9.8.8. Example - COPY of a Collection .....................56
148 9.9. MOVE Method ...............................................56
149 9.9.1. MOVE for Properties ................................57
150 9.9.2. MOVE for Collections ...............................57
151 9.9.3. MOVE and the Overwrite Header ......................58
152 9.9.4. Status Codes .......................................59
153 9.9.5. Example - MOVE of a Non-Collection .................60
154 9.9.6. Example - MOVE of a Collection .....................60
155 9.10. LOCK Method ..............................................61
156 9.10.1. Creating a Lock on an Existing Resource ...........61
157 9.10.2. Refreshing Locks ..................................62
158 9.10.3. Depth and Locking .................................62
159 9.10.4. Locking Unmapped URLs .............................63
160 9.10.5. Lock Compatibility Table ..........................63
161 9.10.6. LOCK Responses ....................................63
162 9.10.7. Example - Simple Lock Request .....................64
163 9.10.8. Example - Refreshing a Write Lock .................65
164 9.10.9. Example - Multi-Resource Lock Request .............66
165 9.11. UNLOCK Method ............................................68
166 9.11.1. Status Codes ......................................68
167
168
169
170Dusseault Standards Track [Page 3]
171
172RFC 4918 WebDAV June 2007
173
174
175 9.11.2. Example - UNLOCK ..................................69
176 10. HTTP Headers for Distributed Authoring ........................69
177 10.1. DAV Header ...............................................69
178 10.2. Depth Header .............................................70
179 10.3. Destination Header .......................................71
180 10.4. If Header ................................................72
181 10.4.1. Purpose ...........................................72
182 10.4.2. Syntax ............................................72
183 10.4.3. List Evaluation ...................................73
184 10.4.4. Matching State Tokens and ETags ...................74
185 10.4.5. If Header and Non-DAV-Aware Proxies ...............74
186 10.4.6. Example - No-tag Production .......................75
187 10.4.7. Example - Using "Not" with No-tag Production ......75
188 10.4.8. Example - Causing a Condition to Always
189 Evaluate to True ..................................75
190 10.4.9. Example - Tagged List If Header in COPY ...........76
191 10.4.10. Example - Matching Lock Tokens with
192 Collection Locks .................................76
193 10.4.11. Example - Matching ETags on Unmapped URLs ........76
194 10.5. Lock-Token Header ........................................77
195 10.6. Overwrite Header .........................................77
196 10.7. Timeout Request Header ...................................78
197 11. Status Code Extensions to HTTP/1.1 ............................78
198 11.1. 207 Multi-Status .........................................78
199 11.2. 422 Unprocessable Entity .................................78
200 11.3. 423 Locked ...............................................78
201 11.4. 424 Failed Dependency ....................................79
202 11.5. 507 Insufficient Storage .................................79
203 12. Use of HTTP Status Codes ......................................79
204 12.1. 412 Precondition Failed ..................................79
205 12.2. 414 Request-URI Too Long .................................79
206 13. Multi-Status Response .........................................80
207 13.1. Response Headers .........................................80
208 13.2. Handling Redirected Child Resources ......................81
209 13.3. Internal Status Codes ....................................81
210 14. XML Element Definitions .......................................81
211 14.1. activelock XML Element ...................................81
212 14.2. allprop XML Element ......................................82
213 14.3. collection XML Element ...................................82
214 14.4. depth XML Element ........................................82
215 14.5. error XML Element ........................................82
216 14.6. exclusive XML Element ....................................83
217 14.7. href XML Element .........................................83
218 14.8. include XML Element ......................................83
219 14.9. location XML Element .....................................83
220 14.10. lockentry XML Element ...................................84
221 14.11. lockinfo XML Element ....................................84
222 14.12. lockroot XML Element ....................................84
223
224
225
226Dusseault Standards Track [Page 4]
227
228RFC 4918 WebDAV June 2007
229
230
231 14.13. lockscope XML Element ...................................84
232 14.14. locktoken XML Element ...................................85
233 14.15. locktype XML Element ....................................85
234 14.16. multistatus XML Element .................................85
235 14.17. owner XML Element .......................................85
236 14.18. prop XML Element ........................................86
237 14.19. propertyupdate XML Element ..............................86
238 14.20. propfind XML Element ....................................86
239 14.21. propname XML Element ....................................87
240 14.22. propstat XML Element ....................................87
241 14.23. remove XML Element ......................................87
242 14.24. response XML Element ....................................88
243 14.25. responsedescription XML Element .........................88
244 14.26. set XML Element .........................................88
245 14.27. shared XML Element ......................................89
246 14.28. status XML Element ......................................89
247 14.29. timeout XML Element .....................................89
248 14.30. write XML Element .......................................89
249 15. DAV Properties ................................................90
250 16. Precondition/Postcondition XML Elements .......................98
251 17. XML Extensibility in DAV .....................................101
252 18. DAV Compliance Classes .......................................103
253 18.1. Class 1 .................................................103
254 18.2. Class 2 .................................................103
255 18.3. Class 3 .................................................103
256 19. Internationalization Considerations ..........................104
257 20. Security Considerations ......................................105
258 20.1. Authentication of Clients ...............................105
259 20.2. Denial of Service .......................................106
260 20.3. Security through Obscurity ..............................106
261 20.4. Privacy Issues Connected to Locks .......................106
262 20.5. Privacy Issues Connected to Properties ..................107
263 20.6. Implications of XML Entities ............................107
264 20.7. Risks Connected with Lock Tokens ........................108
265 20.8. Hosting Malicious Content ...............................108
266 21. IANA Considerations ..........................................109
267 21.1. New URI Schemes .........................................109
268 21.2. XML Namespaces ..........................................109
269 21.3. Message Header Fields ...................................109
270 21.3.1. DAV ..............................................109
271 21.3.2. Depth ............................................110
272 21.3.3. Destination ......................................110
273 21.3.4. If ...............................................110
274 21.3.5. Lock-Token .......................................110
275 21.3.6. Overwrite ........................................111
276 21.3.7. Timeout ..........................................111
277 21.4. HTTP Status Codes .......................................111
278 22. Acknowledgements .............................................112
279
280
281
282Dusseault Standards Track [Page 5]
283
284RFC 4918 WebDAV June 2007
285
286
287 23. Contributors to This Specification ...........................113
288 24. Authors of RFC 2518 ..........................................113
289 25. References ...................................................114
290 25.1. Normative References.....................................114
291 25.2. Informative References ..................................115
292 Appendix A. Notes on Processing XML Elements ....................117
293 A.1. Notes on Empty XML Elements ..............................117
294 A.2. Notes on Illegal XML Processing ..........................117
295 A.3. Example - XML Syntax Error ...............................117
296 A.4. Example - Unexpected XML Element .........................118
297 Appendix B. Notes on HTTP Client Compatibility ...................119
298 Appendix C. The 'opaquelocktoken' Scheme and URIs ................120
299 Appendix D. Lock-null Resources ..................................120
300 D.1. Guidance for Clients Using LOCK to Create Resources ......121
301 Appendix E. Guidance for Clients Desiring to Authenticate ........121
302 Appendix F. Summary of Changes from RFC 2518 .....................123
303 F.1. Changes for Both Client and Server Implementations .......123
304 F.2. Changes for Server Implementations .......................125
305 F.3. Other Changes ............................................126
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338Dusseault Standards Track [Page 6]
339
340RFC 4918 WebDAV June 2007
341
342
3431. Introduction
344
345 This document describes an extension to the HTTP/1.1 protocol that
346 allows clients to perform remote Web content authoring operations.
347 This extension provides a coherent set of methods, headers, request
348 entity body formats, and response entity body formats that provide
349 operations for:
350
351 Properties: The ability to create, remove, and query information
352 about Web pages, such as their authors, creation dates, etc.
353
354 Collections: The ability to create sets of documents and to retrieve
355 a hierarchical membership listing (like a directory listing in a file
356 system).
357
358 Locking: The ability to keep more than one person from working on a
359 document at the same time. This prevents the "lost update problem",
360 in which modifications are lost as first one author, then another,
361 writes changes without merging the other author's changes.
362
363 Namespace Operations: The ability to instruct the server to copy and
364 move Web resources, operations that change the mapping from URLs to
365 resources.
366
367 Requirements and rationale for these operations are described in a
368 companion document, "Requirements for a Distributed Authoring and
369 Versioning Protocol for the World Wide Web" [RFC2291].
370
371 This document does not specify the versioning operations suggested by
372 [RFC2291]. That work was done in a separate document, "Versioning
373 Extensions to WebDAV" [RFC3253].
374
375 The sections below provide a detailed introduction to various WebDAV
376 abstractions: resource properties (Section 4), collections of
377 resources (Section 5), locks (Section 6) in general, and write locks
378 (Section 7) specifically.
379
380 These abstractions are manipulated by the WebDAV-specific HTTP
381 methods (Section 9) and the extra HTTP headers (Section 10) used with
382 WebDAV methods. General considerations for handling HTTP requests
383 and responses in WebDAV are found in Section 8.
384
385 While the status codes provided by HTTP/1.1 are sufficient to
386 describe most error conditions encountered by WebDAV methods, there
387 are some errors that do not fall neatly into the existing categories.
388 This specification defines extra status codes developed for WebDAV
389 methods (Section 11) and describes existing HTTP status codes
390 (Section 12) as used in WebDAV. Since some WebDAV methods may
391
392
393
394Dusseault Standards Track [Page 7]
395
396RFC 4918 WebDAV June 2007
397
398
399 operate over many resources, the Multi-Status response (Section 13)
400 has been introduced to return status information for multiple
401 resources. Finally, this version of WebDAV introduces precondition
402 and postcondition (Section 16) XML elements in error response bodies.
403
404 WebDAV uses XML ([REC-XML]) for property names and some values, and
405 also uses XML to marshal complicated requests and responses. This
406 specification contains DTD and text definitions of all properties
407 (Section 15) and all other XML elements (Section 14) used in
408 marshalling. WebDAV includes a few special rules on extending WebDAV
409 XML marshalling in backwards-compatible ways (Section 17).
410
411 Finishing off the specification are sections on what it means for a
412 resource to be compliant with this specification (Section 18), on
413 internationalization support (Section 19), and on security
414 (Section 20).
415
4162. Notational Conventions
417
418 Since this document describes a set of extensions to the HTTP/1.1
419 protocol, the augmented BNF used herein to describe protocol elements
420 is exactly the same as described in Section 2.1 of [RFC2616],
421 including the rules about implied linear whitespace. Since this
422 augmented BNF uses the basic production rules provided in Section 2.2
423 of [RFC2616], these rules apply to this document as well. Note this
424 is not the standard BNF syntax used in other RFCs.
425
426 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
427 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
428 document are to be interpreted as described in [RFC2119].
429
430 Note that in natural language, a property like the "creationdate"
431 property in the "DAV:" XML namespace is sometimes referred to as
432 "DAV:creationdate" for brevity.
433
4343. Terminology
435
436 URI/URL - A Uniform Resource Identifier and Uniform Resource Locator,
437 respectively. These terms (and the distinction between them) are
438 defined in [RFC3986].
439
440 URI/URL Mapping - A relation between an absolute URI and a resource.
441 Since a resource can represent items that are not network
442 retrievable, as well as those that are, it is possible for a resource
443 to have zero, one, or many URI mappings. Mapping a resource to an
444 "http" scheme URI makes it possible to submit HTTP protocol requests
445 to the resource using the URI.
446
447
448
449
450Dusseault Standards Track [Page 8]
451
452RFC 4918 WebDAV June 2007
453
454
455 Path Segment - Informally, the characters found between slashes ("/")
456 in a URI. Formally, as defined in Section 3.3 of [RFC3986].
457
458 Collection - Informally, a resource that also acts as a container of
459 references to child resources. Formally, a resource that contains a
460 set of mappings between path segments and resources and meets the
461 requirements defined in Section 5.
462
463 Internal Member (of a Collection) - Informally, a child resource of a
464 collection. Formally, a resource referenced by a path segment
465 mapping contained in the collection.
466
467 Internal Member URL (of a Collection) - A URL of an internal member,
468 consisting of the URL of the collection (including trailing slash)
469 plus the path segment identifying the internal member.
470
471 Member (of a Collection) - Informally, a "descendant" of a
472 collection. Formally, an internal member of the collection, or,
473 recursively, a member of an internal member.
474
475 Member URL (of a Collection) - A URL that is either an internal
476 member URL of the collection itself, or is an internal member URL of
477 a member of that collection.
478
479 Property - A name/value pair that contains descriptive information
480 about a resource.
481
482 Live Property - A property whose semantics and syntax are enforced by
483 the server. For example, the live property DAV:getcontentlength has
484 its value, the length of the entity returned by a GET request,
485 automatically calculated by the server.
486
487 Dead Property - A property whose semantics and syntax are not
488 enforced by the server. The server only records the value of a dead
489 property; the client is responsible for maintaining the consistency
490 of the syntax and semantics of a dead property.
491
492 Principal - A distinct human or computational actor that initiates
493 access to network resources.
494
495 State Token - A URI that represents a state of a resource. Lock
496 tokens are the only state tokens defined in this specification.
497
498
499
500
501
502
503
504
505
506Dusseault Standards Track [Page 9]
507
508RFC 4918 WebDAV June 2007
509
510
5114. Data Model for Resource Properties
512
5134.1. The Resource Property Model
514
515 Properties are pieces of data that describe the state of a resource.
516 Properties are data about data.
517
518 Properties are used in distributed authoring environments to provide
519 for efficient discovery and management of resources. For example, a
520 'subject' property might allow for the indexing of all resources by
521 their subject, and an 'author' property might allow for the discovery
522 of what authors have written which documents.
523
524 The DAV property model consists of name/value pairs. The name of a
525 property identifies the property's syntax and semantics, and provides
526 an address by which to refer to its syntax and semantics.
527
528 There are two categories of properties: "live" and "dead". A live
529 property has its syntax and semantics enforced by the server. Live
530 properties include cases where a) the value of a property is
531 protected and maintained by the server, and b) the value of the
532 property is maintained by the client, but the server performs syntax
533 checking on submitted values. All instances of a given live property
534 MUST comply with the definition associated with that property name.
535 A dead property has its syntax and semantics enforced by the client;
536 the server merely records the value of the property verbatim.
537
5384.2. Properties and HTTP Headers
539
540 Properties already exist, in a limited sense, in HTTP message
541 headers. However, in distributed authoring environments, a
542 relatively large number of properties are needed to describe the
543 state of a resource, and setting/returning them all through HTTP
544 headers is inefficient. Thus, a mechanism is needed that allows a
545 principal to identify a set of properties in which the principal is
546 interested and to set or retrieve just those properties.
547
5484.3. Property Values
549
550 The value of a property is always a (well-formed) XML fragment.
551
552 XML has been chosen because it is a flexible, self-describing,
553 structured data format that supports rich schema definitions, and
554 because of its support for multiple character sets. XML's self-
555 describing nature allows any property's value to be extended by
556 adding elements. Clients will not break when they encounter
557 extensions because they will still have the data specified in the
558 original schema and MUST ignore elements they do not understand.
559
560
561
562Dusseault Standards Track [Page 10]
563
564RFC 4918 WebDAV June 2007
565
566
567 XML's support for multiple character sets allows any human-readable
568 property to be encoded and read in a character set familiar to the
569 user. XML's support for multiple human languages, using the "xml:
570 lang" attribute, handles cases where the same character set is
571 employed by multiple human languages. Note that xml:lang scope is
572 recursive, so an xml:lang attribute on any element containing a
573 property name element applies to the property value unless it has
574 been overridden by a more locally scoped attribute. Note that a
575 property only has one value, in one language (or language MAY be left
576 undefined); a property does not have multiple values in different
577 languages or a single value in multiple languages.
578
579 A property is always represented with an XML element consisting of
580 the property name, called the "property name element". The simplest
581 example is an empty property, which is different from a property that
582 does not exist:
583
584 <R:title xmlns:R="http://www.example.com/ns/"></R:title>
585
586 The value of the property appears inside the property name element.
587 The value may be any kind of well-formed XML content, including both
588 text-only and mixed content. Servers MUST preserve the following XML
589 Information Items (using the terminology from [REC-XML-INFOSET]) in
590 storage and transmission of dead properties:
591
592 For the property name Element Information Item itself:
593
594 [namespace name]
595
596 [local name]
597
598 [attributes] named "xml:lang" or any such attribute in scope
599
600 [children] of type element or character
601
602 On all Element Information Items in the property value:
603
604 [namespace name]
605
606 [local name]
607
608 [attributes]
609
610 [children] of type element or character
611
612
613
614
615
616
617
618Dusseault Standards Track [Page 11]
619
620RFC 4918 WebDAV June 2007
621
622
623 On Attribute Information Items in the property value:
624
625 [namespace name]
626
627 [local name]
628
629 [normalized value]
630
631 On Character Information Items in the property value:
632
633 [character code]
634
635 Since prefixes are used in some XML vocabularies (XPath and XML
636 Schema, for example), servers SHOULD preserve, for any Information
637 Item in the value:
638
639 [prefix]
640
641 XML Infoset attributes not listed above MAY be preserved by the
642 server, but clients MUST NOT rely on them being preserved. The above
643 rules would also apply by default to live properties, unless defined
644 otherwise.
645
646 Servers MUST ignore the XML attribute xml:space if present and never
647 use it to change whitespace handling. Whitespace in property values
648 is significant.
649
6504.3.1. Example - Property with Mixed Content
651
652 Consider a dead property 'author' created by the client as follows:
653
654 <D:prop xml:lang="en" xmlns:D="DAV:">
655 <x:author xmlns:x='http://example.com/ns'>
656 <x:name>Jane Doe</x:name>
657 <!-- Jane's contact info -->
658 <x:uri type='email'
659 added='2005-11-26'>mailto:jane.doe@example.com</x:uri>
660 <x:uri type='web'
661 added='2005-11-27'>http://www.example.com</x:uri>
662 <x:notes xmlns:h='http://www.w3.org/1999/xhtml'>
663 Jane has been working way <h:em>too</h:em> long on the
664 long-awaited revision of <![CDATA[<RFC2518>]]>.
665 </x:notes>
666 </x:author>
667 </D:prop>
668
669
670
671
672
673
674Dusseault Standards Track [Page 12]
675
676RFC 4918 WebDAV June 2007
677
678
679 When this property is requested, a server might return:
680
681 <D:prop xmlns:D='DAV:'><author
682 xml:lang='en'
683 xmlns:x='http://example.com/ns'
684 xmlns='http://example.com/ns'
685 xmlns:h='http://www.w3.org/1999/xhtml'>
686 <x:name>Jane Doe</x:name>
687 <x:uri added="2005-11-26" type="email"
688 >mailto:jane.doe@example.com</x:uri>
689 <x:uri added="2005-11-27" type="web"
690 >http://www.example.com</x:uri>
691 <x:notes>
692 Jane has been working way <h:em>too</h:em> long on the
693 long-awaited revision of &lt;RFC2518&gt;.
694 </x:notes>
695 </author>
696 </D:prop>
697
698 Note in this example:
699
700 o The [prefix] for the property name itself was not preserved, being
701 non-significant, whereas all other [prefix] values have been
702 preserved,
703
704 o attribute values have been rewritten with double quotes instead of
705 single quotes (quoting style is not significant), and attribute
706 order has not been preserved,
707
708 o the xml:lang attribute has been returned on the property name
709 element itself (it was in scope when the property was set, but the
710 exact position in the response is not considered significant as
711 long as it is in scope),
712
713 o whitespace between tags has been preserved everywhere (whitespace
714 between attributes not so),
715
716 o CDATA encapsulation was replaced with character escaping (the
717 reverse would also be legal),
718
719 o the comment item was stripped (as would have been a processing
720 instruction item).
721
722 Implementation note: there are cases such as editing scenarios where
723 clients may require that XML content is preserved character by
724 character (such as attribute ordering or quoting style). In this
725 case, clients should consider using a text-only property value by
726 escaping all characters that have a special meaning in XML parsing.
727
728
729
730Dusseault Standards Track [Page 13]
731
732RFC 4918 WebDAV June 2007
733
734
7354.4. Property Names
736
737 A property name is a universally unique identifier that is associated
738 with a schema that provides information about the syntax and
739 semantics of the property.
740
741 Because a property's name is universally unique, clients can depend
742 upon consistent behavior for a particular property across multiple
743 resources, on the same and across different servers, so long as that
744 property is "live" on the resources in question, and the
745 implementation of the live property is faithful to its definition.
746
747 The XML namespace mechanism, which is based on URIs ([RFC3986]), is
748 used to name properties because it prevents namespace collisions and
749 provides for varying degrees of administrative control.
750
751 The property namespace is flat; that is, no hierarchy of properties
752 is explicitly recognized. Thus, if a property A and a property A/B
753 exist on a resource, there is no recognition of any relationship
754 between the two properties. It is expected that a separate
755 specification will eventually be produced that will address issues
756 relating to hierarchical properties.
757
758 Finally, it is not possible to define the same property twice on a
759 single resource, as this would cause a collision in the resource's
760 property namespace.
761
7624.5. Source Resources and Output Resources
763
764 Some HTTP resources are dynamically generated by the server. For
765 these resources, there presumably exists source code somewhere
766 governing how that resource is generated. The relationship of source
767 files to output HTTP resources may be one to one, one to many, many
768 to one, or many to many. There is no mechanism in HTTP to determine
769 whether a resource is even dynamic, let alone where its source files
770 exist or how to author them. Although this problem would usefully be
771 solved, interoperable WebDAV implementations have been widely
772 deployed without actually solving this problem, by dealing only with
773 static resources. Thus, the source vs. output problem is not solved
774 in this specification and has been deferred to a separate document.
775
7765. Collections of Web Resources
777
778 This section provides a description of a type of Web resource, the
779 collection, and discusses its interactions with the HTTP URL
780 namespace and with HTTP methods. The purpose of a collection
781 resource is to model collection-like objects (e.g., file system
782 directories) within a server's namespace.
783
784
785
786Dusseault Standards Track [Page 14]
787
788RFC 4918 WebDAV June 2007
789
790
791 All DAV-compliant resources MUST support the HTTP URL namespace model
792 specified herein.
793
7945.1. HTTP URL Namespace Model
795
796 The HTTP URL namespace is a hierarchical namespace where the
797 hierarchy is delimited with the "/" character.
798
799 An HTTP URL namespace is said to be consistent if it meets the
800 following conditions: for every URL in the HTTP hierarchy there
801 exists a collection that contains that URL as an internal member URL.
802 The root, or top-level collection of the namespace under
803 consideration, is exempt from the previous rule. The top-level
804 collection of the namespace under consideration is not necessarily
805 the collection identified by the absolute path '/' -- it may be
806 identified by one or more path segments (e.g., /servlets/webdav/...)
807
808 Neither HTTP/1.1 nor WebDAV requires that the entire HTTP URL
809 namespace be consistent -- a WebDAV-compatible resource may not have
810 a parent collection. However, certain WebDAV methods are prohibited
811 from producing results that cause namespace inconsistencies.
812
813 As is implicit in [RFC2616] and [RFC3986], any resource, including
814 collection resources, MAY be identified by more than one URI. For
815 example, a resource could be identified by multiple HTTP URLs.
816
8175.2. Collection Resources
818
819 Collection resources differ from other resources in that they also
820 act as containers. Some HTTP methods apply only to a collection, but
821 some apply to some or all of the resources inside the container
822 defined by the collection. When the scope of a method is not clear,
823 the client can specify what depth to apply. Depth can be either zero
824 levels (only the collection), one level (the collection and directly
825 contained resources), or infinite levels (the collection and all
826 contained resources recursively).
827
828 A collection's state consists of at least a set of mappings between
829 path segments and resources, and a set of properties on the
830 collection itself. In this document, a resource B will be said to be
831 contained in the collection resource A if there is a path segment
832 mapping that maps to B and that is contained in A. A collection MUST
833 contain at most one mapping for a given path segment, i.e., it is
834 illegal to have the same path segment mapped to more than one
835 resource.
836
837
838
839
840
841
842Dusseault Standards Track [Page 15]
843
844RFC 4918 WebDAV June 2007
845
846
847 Properties defined on collections behave exactly as do properties on
848 non-collection resources. A collection MAY have additional state
849 such as entity bodies returned by GET.
850
851 For all WebDAV-compliant resources A and B, identified by URLs "U"
852 and "V", respectively, such that "V" is equal to "U/SEGMENT", A MUST
853 be a collection that contains a mapping from "SEGMENT" to B. So, if
854 resource B with URL "http://example.com/bar/blah" is WebDAV compliant
855 and if resource A with URL "http://example.com/bar/" is WebDAV
856 compliant, then resource A must be a collection and must contain
857 exactly one mapping from "blah" to B.
858
859 Although commonly a mapping consists of a single segment and a
860 resource, in general, a mapping consists of a set of segments and a
861 resource. This allows a server to treat a set of segments as
862 equivalent (i.e., either all of the segments are mapped to the same
863 resource, or none of the segments are mapped to a resource). For
864 example, a server that performs case-folding on segments will treat
865 the segments "ab", "Ab", "aB", and "AB" as equivalent. A client can
866 then use any of these segments to identify the resource. Note that a
867 PROPFIND result will select one of these equivalent segments to
868 identify the mapping, so there will be one PROPFIND response element
869 per mapping, not one per segment in the mapping.
870
871 Collection resources MAY have mappings to non-WebDAV-compliant
872 resources in the HTTP URL namespace hierarchy but are not required to
873 do so. For example, if resource X with URL
874 "http://example.com/bar/blah" is not WebDAV compliant and resource A
875 with "URL http://example.com/bar/" identifies a WebDAV collection,
876 then A may or may not have a mapping from "blah" to X.
877
878 If a WebDAV-compliant resource has no WebDAV-compliant internal
879 members in the HTTP URL namespace hierarchy, then the WebDAV-
880 compliant resource is not required to be a collection.
881
882 There is a standing convention that when a collection is referred to
883 by its name without a trailing slash, the server MAY handle the
884 request as if the trailing slash were present. In this case, it
885 SHOULD return a Content-Location header in the response, pointing to
886 the URL ending with the "/". For example, if a client invokes a
887 method on http://example.com/blah (no trailing slash), the server may
888 respond as if the operation were invoked on http://example.com/blah/
889 (trailing slash), and should return a Content-Location header with
890 the value http://example.com/blah/. Wherever a server produces a URL
891 referring to a collection, the server SHOULD include the trailing
892 slash. In general, clients SHOULD use the trailing slash form of
893 collection names. If clients do not use the trailing slash form the
894 client needs to be prepared to see a redirect response. Clients will
895
896
897
898Dusseault Standards Track [Page 16]
899
900RFC 4918 WebDAV June 2007
901
902
903 find the DAV:resourcetype property more reliable than the URL to find
904 out if a resource is a collection.
905
906 Clients MUST be able to support the case where WebDAV resources are
907 contained inside non-WebDAV resources. For example, if an OPTIONS
908 response from "http://example.com/servlet/dav/collection" indicates
909 WebDAV support, the client cannot assume that
910 "http://example.com/servlet/dav/" or its parent necessarily are
911 WebDAV collections.
912
913 A typical scenario in which mapped URLs do not appear as members of
914 their parent collection is the case where a server allows links or
915 redirects to non-WebDAV resources. For instance, "/col/link" might
916 not appear as a member of "/col/", although the server would respond
917 with a 302 status to a GET request to "/col/link"; thus, the URL
918 "/col/link" would indeed be mapped. Similarly, a dynamically-
919 generated page might have a URL mapping from "/col/index.html", thus
920 this resource might respond with a 200 OK to a GET request yet not
921 appear as a member of "/col/".
922
923 Some mappings to even WebDAV-compliant resources might not appear in
924 the parent collection. An example for this case are servers that
925 support multiple alias URLs for each WebDAV-compliant resource. A
926 server may implement case-insensitive URLs, thus "/col/a" and
927 "/col/A" identify the same resource, yet only either "a" or "A" is
928 reported upon listing the members of "/col". In cases where a server
929 treats a set of segments as equivalent, the server MUST expose only
930 one preferred segment per mapping, consistently chosen, in PROPFIND
931 responses.
932
9336. Locking
934
935 The ability to lock a resource provides a mechanism for serializing
936 access to that resource. Using a lock, an authoring client can
937 provide a reasonable guarantee that another principal will not modify
938 a resource while it is being edited. In this way, a client can
939 prevent the "lost update" problem.
940
941 This specification allows locks to vary over two client-specified
942 parameters, the number of principals involved (exclusive vs. shared)
943 and the type of access to be granted. This document defines locking
944 for only one access type, write. However, the syntax is extensible,
945 and permits the eventual specification of locking for other access
946 types.
947
948
949
950
951
952
953
954Dusseault Standards Track [Page 17]
955
956RFC 4918 WebDAV June 2007
957
958
9596.1. Lock Model
960
961 This section provides a concise model for how locking behaves. Later
962 sections will provide more detail on some of the concepts and refer
963 back to these model statements. Normative statements related to LOCK
964 and UNLOCK method handling can be found in the sections on those
965 methods, whereas normative statements that cover any method are
966 gathered here.
967
968 1. A lock either directly or indirectly locks a resource.
969
970 2. A resource becomes directly locked when a LOCK request to a URL
971 of that resource creates a new lock. The "lock-root" of the new
972 lock is that URL. If at the time of the request, the URL is not
973 mapped to a resource, a new empty resource is created and
974 directly locked.
975
976 3. An exclusive lock (Section 6.2) conflicts with any other kind of
977 lock on the same resource, whether either lock is direct or
978 indirect. A server MUST NOT create conflicting locks on a
979 resource.
980
981 4. For a collection that is locked with a depth-infinity lock L, all
982 member resources are indirectly locked. Changes in membership of
983 such a collection affect the set of indirectly locked resources:
984
985 * If a member resource is added to the collection, the new
986 member resource MUST NOT already have a conflicting lock,
987 because the new resource MUST become indirectly locked by L.
988
989 * If a member resource stops being a member of the collection,
990 then the resource MUST no longer be indirectly locked by L.
991
992 5. Each lock is identified by a single globally unique lock token
993 (Section 6.5).
994
995 6. An UNLOCK request deletes the lock with the specified lock token.
996 After a lock is deleted, no resource is locked by that lock.
997
998 7. A lock token is "submitted" in a request when it appears in an
999 "If" header (Section 7, "Write Lock", discusses when token
1000 submission is required for write locks).
1001
1002 8. If a request causes the lock-root of any lock to become an
1003 unmapped URL, then the lock MUST also be deleted by that request.
1004
1005
1006
1007
1008
1009
1010Dusseault Standards Track [Page 18]
1011
1012RFC 4918 WebDAV June 2007
1013
1014
10156.2. Exclusive vs. Shared Locks
1016
1017 The most basic form of lock is an exclusive lock. Exclusive locks
1018 avoid having to deal with content change conflicts, without requiring
1019 any coordination other than the methods described in this
1020 specification.
1021
1022 However, there are times when the goal of a lock is not to exclude
1023 others from exercising an access right but rather to provide a
1024 mechanism for principals to indicate that they intend to exercise
1025 their access rights. Shared locks are provided for this case. A
1026 shared lock allows multiple principals to receive a lock. Hence any
1027 principal that has both access privileges and a valid lock can use
1028 the locked resource.
1029
1030 With shared locks, there are two trust sets that affect a resource.
1031 The first trust set is created by access permissions. Principals who
1032 are trusted, for example, may have permission to write to the
1033 resource. Among those who have access permission to write to the
1034 resource, the set of principals who have taken out a shared lock also
1035 must trust each other, creating a (typically) smaller trust set
1036 within the access permission write set.
1037
1038 Starting with every possible principal on the Internet, in most
1039 situations the vast majority of these principals will not have write
1040 access to a given resource. Of the small number who do have write
1041 access, some principals may decide to guarantee their edits are free
1042 from overwrite conflicts by using exclusive write locks. Others may
1043 decide they trust their collaborators will not overwrite their work
1044 (the potential set of collaborators being the set of principals who
1045 have write permission) and use a shared lock, which informs their
1046 collaborators that a principal may be working on the resource.
1047
1048 The WebDAV extensions to HTTP do not need to provide all of the
1049 communications paths necessary for principals to coordinate their
1050 activities. When using shared locks, principals may use any out-of-
1051 band communication channel to coordinate their work (e.g., face-to-
1052 face interaction, written notes, post-it notes on the screen,
1053 telephone conversation, email, etc.) The intent of a shared lock is
1054 to let collaborators know who else may be working on a resource.
1055
1056 Shared locks are included because experience from Web-distributed
1057 authoring systems has indicated that exclusive locks are often too
1058 rigid. An exclusive lock is used to enforce a particular editing
1059 process: take out an exclusive lock, read the resource, perform
1060 edits, write the resource, release the lock. This editing process
1061 has the problem that locks are not always properly released, for
1062 example, when a program crashes or when a lock creator leaves without
1063
1064
1065
1066Dusseault Standards Track [Page 19]
1067
1068RFC 4918 WebDAV June 2007
1069
1070
1071 unlocking a resource. While both timeouts (Section 6.6) and
1072 administrative action can be used to remove an offending lock,
1073 neither mechanism may be available when needed; the timeout may be
1074 long or the administrator may not be available.
1075
1076 A successful request for a new shared lock MUST result in the
1077 generation of a unique lock associated with the requesting principal.
1078 Thus, if five principals have taken out shared write locks on the
1079 same resource, there will be five locks and five lock tokens, one for
1080 each principal.
1081
10826.3. Required Support
1083
1084 A WebDAV-compliant resource is not required to support locking in any
1085 form. If the resource does support locking, it may choose to support
1086 any combination of exclusive and shared locks for any access types.
1087
1088 The reason for this flexibility is that locking policy strikes to the
1089 very heart of the resource management and versioning systems employed
1090 by various storage repositories. These repositories require control
1091 over what sort of locking will be made available. For example, some
1092 repositories only support shared write locks, while others only
1093 provide support for exclusive write locks, while yet others use no
1094 locking at all. As each system is sufficiently different to merit
1095 exclusion of certain locking features, this specification leaves
1096 locking as the sole axis of negotiation within WebDAV.
1097
10986.4. Lock Creator and Privileges
1099
1100 The creator of a lock has special privileges to use the lock to
1101 modify the resource. When a locked resource is modified, a server
1102 MUST check that the authenticated principal matches the lock creator
1103 (in addition to checking for valid lock token submission).
1104
1105 The server MAY allow privileged users other than the lock creator to
1106 destroy a lock (for example, the resource owner or an administrator).
1107 The 'unlock' privilege in [RFC3744] was defined to provide that
1108 permission.
1109
1110 There is no requirement for servers to accept LOCK requests from all
1111 users or from anonymous users.
1112
1113 Note that having a lock does not confer full privilege to modify the
1114 locked resource. Write access and other privileges MUST be enforced
1115 through normal privilege or authentication mechanisms, not based on
1116 the possible obscurity of lock token values.
1117
1118
1119
1120
1121
1122Dusseault Standards Track [Page 20]
1123
1124RFC 4918 WebDAV June 2007
1125
1126
11276.5. Lock Tokens
1128
1129 A lock token is a type of state token that identifies a particular
1130 lock. Each lock has exactly one unique lock token generated by the
1131 server. Clients MUST NOT attempt to interpret lock tokens in any
1132 way.
1133
1134 Lock token URIs MUST be unique across all resources for all time.
1135 This uniqueness constraint allows lock tokens to be submitted across
1136 resources and servers without fear of confusion. Since lock tokens
1137 are unique, a client MAY submit a lock token in an If header on a
1138 resource other than the one that returned it.
1139
1140 When a LOCK operation creates a new lock, the new lock token is
1141 returned in the Lock-Token response header defined in Section 10.5,
1142 and also in the body of the response.
1143
1144 Servers MAY make lock tokens publicly readable (e.g., in the DAV:
1145 lockdiscovery property). One use case for making lock tokens
1146 readable is so that a long-lived lock can be removed by the resource
1147 owner (the client that obtained the lock might have crashed or
1148 disconnected before cleaning up the lock). Except for the case of
1149 using UNLOCK under user guidance, a client SHOULD NOT use a lock
1150 token created by another client instance.
1151
1152 This specification encourages servers to create Universally Unique
1153 Identifiers (UUIDs) for lock tokens, and to use the URI form defined
1154 by "A Universally Unique Identifier (UUID) URN Namespace"
1155 ([RFC4122]). However, servers are free to use any URI (e.g., from
1156 another scheme) so long as it meets the uniqueness requirements. For
1157 example, a valid lock token might be constructed using the
1158 "opaquelocktoken" scheme defined in Appendix C.
1159
1160 Example: "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
1161
11626.6. Lock Timeout
1163
1164 A lock MAY have a limited lifetime. The lifetime is suggested by the
1165 client when creating or refreshing the lock, but the server
1166 ultimately chooses the timeout value. Timeout is measured in seconds
1167 remaining until lock expiration.
1168
1169 The timeout counter MUST be restarted if a refresh lock request is
1170 successful (see Section 9.10.2). The timeout counter SHOULD NOT be
1171 restarted at any other time.
1172
1173 If the timeout expires, then the lock SHOULD be removed. In this
1174 case the server SHOULD act as if an UNLOCK method was executed by the
1175
1176
1177
1178Dusseault Standards Track [Page 21]
1179
1180RFC 4918 WebDAV June 2007
1181
1182
1183 server on the resource using the lock token of the timed-out lock,
1184 performed with its override authority.
1185
1186 Servers are advised to pay close attention to the values submitted by
1187 clients, as they will be indicative of the type of activity the
1188 client intends to perform. For example, an applet running in a
1189 browser may need to lock a resource, but because of the instability
1190 of the environment within which the applet is running, the applet may
1191 be turned off without warning. As a result, the applet is likely to
1192 ask for a relatively small timeout value so that if the applet dies,
1193 the lock can be quickly harvested. However, a document management
1194 system is likely to ask for an extremely long timeout because its
1195 user may be planning on going offline.
1196
1197 A client MUST NOT assume that just because the timeout has expired,
1198 the lock has immediately been removed.
1199
1200 Likewise, a client MUST NOT assume that just because the timeout has
1201 not expired, the lock still exists. Clients MUST assume that locks
1202 can arbitrarily disappear at any time, regardless of the value given
1203 in the Timeout header. The Timeout header only indicates the
1204 behavior of the server if extraordinary circumstances do not occur.
1205 For example, a sufficiently privileged user may remove a lock at any
1206 time, or the system may crash in such a way that it loses the record
1207 of the lock's existence.
1208
12096.7. Lock Capability Discovery
1210
1211 Since server lock support is optional, a client trying to lock a
1212 resource on a server can either try the lock and hope for the best,
1213 or perform some form of discovery to determine what lock capabilities
1214 the server supports. This is known as lock capability discovery. A
1215 client can determine what lock types the server supports by
1216 retrieving the DAV:supportedlock property.
1217
1218 Any DAV-compliant resource that supports the LOCK method MUST support
1219 the DAV:supportedlock property.
1220
12216.8. Active Lock Discovery
1222
1223 If another principal locks a resource that a principal wishes to
1224 access, it is useful for the second principal to be able to find out
1225 who the first principal is. For this purpose the DAV:lockdiscovery
1226 property is provided. This property lists all outstanding locks,
1227 describes their type, and MAY even provide the lock tokens.
1228
1229 Any DAV-compliant resource that supports the LOCK method MUST support
1230 the DAV:lockdiscovery property.
1231
1232
1233
1234Dusseault Standards Track [Page 22]
1235
1236RFC 4918 WebDAV June 2007
1237
1238
12397. Write Lock
1240
1241 This section describes the semantics specific to the write lock type.
1242 The write lock is a specific instance of a lock type, and is the only
1243 lock type described in this specification.
1244
1245 An exclusive write lock protects a resource: it prevents changes by
1246 any principal other than the lock creator and in any case where the
1247 lock token is not submitted (e.g., by a client process other than the
1248 one holding the lock).
1249
1250 Clients MUST submit a lock-token they are authorized to use in any
1251 request that modifies a write-locked resource. The list of
1252 modifications covered by a write-lock include:
1253
1254 1. A change to any of the following aspects of any write-locked
1255 resource:
1256
1257 * any variant,
1258
1259 * any dead property,
1260
1261 * any live property that is lockable (a live property is
1262 lockable unless otherwise defined.)
1263
1264 2. For collections, any modification of an internal member URI. An
1265 internal member URI of a collection is considered to be modified
1266 if it is added, removed, or identifies a different resource.
1267 More discussion on write locks and collections is found in
1268 Section 7.4.
1269
1270 3. A modification of the mapping of the root of the write lock,
1271 either to another resource or to no resource (e.g., DELETE).
1272
1273 Of the methods defined in HTTP and WebDAV, PUT, POST, PROPPATCH,
1274 LOCK, UNLOCK, MOVE, COPY (for the destination resource), DELETE, and
1275 MKCOL are affected by write locks. All other HTTP/WebDAV methods
1276 defined so far -- GET in particular -- function independently of a
1277 write lock.
1278
1279 The next few sections describe in more specific terms how write locks
1280 interact with various operations.
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290Dusseault Standards Track [Page 23]
1291
1292RFC 4918 WebDAV June 2007
1293
1294
12957.1. Write Locks and Properties
1296
1297 While those without a write lock may not alter a property on a
1298 resource it is still possible for the values of live properties to
1299 change, even while locked, due to the requirements of their schemas.
1300 Only dead properties and live properties defined as lockable are
1301 guaranteed not to change while write locked.
1302
13037.2. Avoiding Lost Updates
1304
1305 Although the write locks provide some help in preventing lost
1306 updates, they cannot guarantee that updates will never be lost.
1307 Consider the following scenario:
1308
1309 Two clients A and B are interested in editing the resource
1310 'index.html'. Client A is an HTTP client rather than a WebDAV
1311 client, and so does not know how to perform locking.
1312
1313 Client A doesn't lock the document, but does a GET, and begins
1314 editing.
1315
1316 Client B does LOCK, performs a GET and begins editing.
1317
1318 Client B finishes editing, performs a PUT, then an UNLOCK.
1319
1320 Client A performs a PUT, overwriting and losing all of B's changes.
1321
1322 There are several reasons why the WebDAV protocol itself cannot
1323 prevent this situation. First, it cannot force all clients to use
1324 locking because it must be compatible with HTTP clients that do not
1325 comprehend locking. Second, it cannot require servers to support
1326 locking because of the variety of repository implementations, some of
1327 which rely on reservations and merging rather than on locking.
1328 Finally, being stateless, it cannot enforce a sequence of operations
1329 like LOCK / GET / PUT / UNLOCK.
1330
1331 WebDAV servers that support locking can reduce the likelihood that
1332 clients will accidentally overwrite each other's changes by requiring
1333 clients to lock resources before modifying them. Such servers would
1334 effectively prevent HTTP 1.0 and HTTP 1.1 clients from modifying
1335 resources.
1336
1337 WebDAV clients can be good citizens by using a lock / retrieve /
1338 write /unlock sequence of operations (at least by default) whenever
1339 they interact with a WebDAV server that supports locking.
1340
1341
1342
1343
1344
1345
1346Dusseault Standards Track [Page 24]
1347
1348RFC 4918 WebDAV June 2007
1349
1350
1351 HTTP 1.1 clients can be good citizens, avoiding overwriting other
1352 clients' changes, by using entity tags in If-Match headers with any
1353 requests that would modify resources.
1354
1355 Information managers may attempt to prevent overwrites by
1356 implementing client-side procedures requiring locking before
1357 modifying WebDAV resources.
1358
13597.3. Write Locks and Unmapped URLs
1360
1361 WebDAV provides the ability to send a LOCK request to an unmapped URL
1362 in order to reserve the name for use. This is a simple way to avoid
1363 the lost-update problem on the creation of a new resource (another
1364 way is to use If-None-Match header specified in Section 14.26 of
1365 [RFC2616]). It has the side benefit of locking the new resource
1366 immediately for use of the creator.
1367
1368 Note that the lost-update problem is not an issue for collections
1369 because MKCOL can only be used to create a collection, not to
1370 overwrite an existing collection. When trying to lock a collection
1371 upon creation, clients can attempt to increase the likelihood of
1372 getting the lock by pipelining the MKCOL and LOCK requests together
1373 (but because this doesn't convert two separate operations into one
1374 atomic operation, there's no guarantee this will work).
1375
1376 A successful lock request to an unmapped URL MUST result in the
1377 creation of a locked (non-collection) resource with empty content.
1378 Subsequently, a successful PUT request (with the correct lock token)
1379 provides the content for the resource. Note that the LOCK request
1380 has no mechanism for the client to provide Content-Type or Content-
1381 Language, thus the server will use defaults or empty values and rely
1382 on the subsequent PUT request for correct values.
1383
1384 A resource created with a LOCK is empty but otherwise behaves in
1385 every way as a normal resource. It behaves the same way as a
1386 resource created by a PUT request with an empty body (and where a
1387 Content-Type and Content-Language was not specified), followed by a
1388 LOCK request to the same resource. Following from this model, a
1389 locked empty resource:
1390
1391 o Can be read, deleted, moved, and copied, and in all ways behaves
1392 as a regular non-collection resource.
1393
1394 o Appears as a member of its parent collection.
1395
1396 o SHOULD NOT disappear when its lock goes away (clients must
1397 therefore be responsible for cleaning up their own mess, as with
1398 any other operation or any non-empty resource).
1399
1400
1401
1402Dusseault Standards Track [Page 25]
1403
1404RFC 4918 WebDAV June 2007
1405
1406
1407 o MAY NOT have values for properties like DAV:getcontentlanguage
1408 that haven't been specified yet by the client.
1409
1410 o Can be updated (have content added) with a PUT request.
1411
1412 o MUST NOT be converted into a collection. The server MUST fail a
1413 MKCOL request (as it would with a MKCOL request to any existing
1414 non-collection resource).
1415
1416 o MUST have defined values for DAV:lockdiscovery and DAV:
1417 supportedlock properties.
1418
1419 o The response MUST indicate that a resource was created, by use of
1420 the "201 Created" response code (a LOCK request to an existing
1421 resource instead will result in 200 OK). The body must still
1422 include the DAV:lockdiscovery property, as with a LOCK request to
1423 an existing resource.
1424
1425 The client is expected to update the locked empty resource shortly
1426 after locking it, using PUT and possibly PROPPATCH.
1427
1428 Alternatively and for backwards compatibility to [RFC2518], servers
1429 MAY implement Lock-Null Resources (LNRs) instead (see definition in
1430 Appendix D). Clients can easily interoperate both with servers that
1431 support the old model LNRs and the recommended model of "locked empty
1432 resources" by only attempting PUT after a LOCK to an unmapped URL,
1433 not MKCOL or GET, and by not relying on specific properties of LNRs.
1434
14357.4. Write Locks and Collections
1436
1437 There are two kinds of collection write locks. A depth-0 write lock
1438 on a collection protects the collection properties plus the internal
1439 member URLs of that one collection, while not protecting the content
1440 or properties of member resources (if the collection itself has any
1441 entity bodies, those are also protected). A depth-infinity write
1442 lock on a collection provides the same protection on that collection
1443 and also provides write lock protection on every member resource.
1444
1445 Expressed otherwise, a write lock of either kind protects any request
1446 that would create a new resource in a write locked collection, any
1447 request that would remove an internal member URL of a write locked
1448 collection, and any request that would change the segment name of any
1449 internal member.
1450
1451 Thus, a collection write lock protects all the following actions:
1452
1453 o DELETE a collection's direct internal member,
1454
1455
1456
1457
1458Dusseault Standards Track [Page 26]
1459
1460RFC 4918 WebDAV June 2007
1461
1462
1463 o MOVE an internal member out of the collection,
1464
1465 o MOVE an internal member into the collection,
1466
1467 o MOVE to rename an internal member within a collection,
1468
1469 o COPY an internal member into a collection, and
1470
1471 o PUT or MKCOL request that would create a new internal member.
1472
1473 The collection's lock token is required in addition to the lock token
1474 on the internal member itself, if it is locked separately.
1475
1476 In addition, a depth-infinity lock affects all write operations to
1477 all members of the locked collection. With a depth-infinity lock,
1478 the resource identified by the root of the lock is directly locked,
1479 and all its members are indirectly locked.
1480
1481 o Any new resource added as a descendant of a depth-infinity locked
1482 collection becomes indirectly locked.
1483
1484 o Any indirectly locked resource moved out of the locked collection
1485 into an unlocked collection is thereafter unlocked.
1486
1487 o Any indirectly locked resource moved out of a locked source
1488 collection into a depth-infinity locked target collection remains
1489 indirectly locked but is now protected by the lock on the target
1490 collection (the target collection's lock token will thereafter be
1491 required to make further changes).
1492
1493 If a depth-infinity write LOCK request is issued to a collection
1494 containing member URLs identifying resources that are currently
1495 locked in a manner that conflicts with the new lock (see Section 6.1,
1496 point 3), the request MUST fail with a 423 (Locked) status code, and
1497 the response SHOULD contain the 'no-conflicting-lock' precondition.
1498
1499 If a lock request causes the URL of a resource to be added as an
1500 internal member URL of a depth-infinity locked collection, then the
1501 new resource MUST be automatically protected by the lock. For
1502 example, if the collection /a/b/ is write locked and the resource /c
1503 is moved to /a/b/c, then resource /a/b/c will be added to the write
1504 lock.
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514Dusseault Standards Track [Page 27]
1515
1516RFC 4918 WebDAV June 2007
1517
1518
15197.5. Write Locks and the If Request Header
1520
1521 A user agent has to demonstrate knowledge of a lock when requesting
1522 an operation on a locked resource. Otherwise, the following scenario
1523 might occur. In the scenario, program A, run by User A, takes out a
1524 write lock on a resource. Program B, also run by User A, has no
1525 knowledge of the lock taken out by program A, yet performs a PUT to
1526 the locked resource. In this scenario, the PUT succeeds because
1527 locks are associated with a principal, not a program, and thus
1528 program B, because it is acting with principal A's credential, is
1529 allowed to perform the PUT. However, had program B known about the
1530 lock, it would not have overwritten the resource, preferring instead
1531 to present a dialog box describing the conflict to the user. Due to
1532 this scenario, a mechanism is needed to prevent different programs
1533 from accidentally ignoring locks taken out by other programs with the
1534 same authorization.
1535
1536 In order to prevent these collisions, a lock token MUST be submitted
1537 by an authorized principal for all locked resources that a method may
1538 change or the method MUST fail. A lock token is submitted when it
1539 appears in an If header. For example, if a resource is to be moved
1540 and both the source and destination are locked, then two lock tokens
1541 must be submitted in the If header, one for the source and the other
1542 for the destination.
1543
15447.5.1. Example - Write Lock and COPY
1545
1546 >>Request
1547
1548 COPY /~fielding/index.html HTTP/1.1
1549 Host: www.example.com
1550 Destination: http://www.example.com/users/f/fielding/index.html
1551 If: <http://www.example.com/users/f/fielding/index.html>
1552 (<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>)
1553
1554 >>Response
1555
1556 HTTP/1.1 204 No Content
1557
1558 In this example, even though both the source and destination are
1559 locked, only one lock token must be submitted (the one for the lock
1560 on the destination). This is because the source resource is not
1561 modified by a COPY, and hence unaffected by the write lock. In this
1562 example, user agent authentication has previously occurred via a
1563 mechanism outside the scope of the HTTP protocol, in the underlying
1564 transport layer.
1565
1566
1567
1568
1569
1570Dusseault Standards Track [Page 28]
1571
1572RFC 4918 WebDAV June 2007
1573
1574
15757.5.2. Example - Deleting a Member of a Locked Collection
1576
1577 Consider a collection "/locked" with an exclusive, depth-infinity
1578 write lock, and an attempt to delete an internal member "/locked/
1579 member":
1580
1581 >>Request
1582
1583 DELETE /locked/member HTTP/1.1
1584 Host: example.com
1585
1586 >>Response
1587
1588 HTTP/1.1 423 Locked
1589 Content-Type: application/xml; charset="utf-8"
1590 Content-Length: xxxx
1591
1592 <?xml version="1.0" encoding="utf-8" ?>
1593 <D:error xmlns:D="DAV:">
1594 <D:lock-token-submitted>
1595 <D:href>/locked/</D:href>
1596 </D:lock-token-submitted>
1597 </D:error>
1598
1599 Thus, the client would need to submit the lock token with the request
1600 to make it succeed. To do that, various forms of the If header (see
1601 Section 10.4) could be used.
1602
1603 "No-Tag-List" format:
1604
1605 If: (<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)
1606
1607 "Tagged-List" format, for "http://example.com/locked/":
1608
1609 If: <http://example.com/locked/>
1610 (<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)
1611
1612 "Tagged-List" format, for "http://example.com/locked/member":
1613
1614 If: <http://example.com/locked/member>
1615 (<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)
1616
1617 Note that, for the purpose of submitting the lock token, the actual
1618 form doesn't matter; what's relevant is that the lock token appears
1619 in the If header, and that the If header itself evaluates to true.
1620
1621
1622
1623
1624
1625
1626Dusseault Standards Track [Page 29]
1627
1628RFC 4918 WebDAV June 2007
1629
1630
16317.6. Write Locks and COPY/MOVE
1632
1633 A COPY method invocation MUST NOT duplicate any write locks active on
1634 the source. However, as previously noted, if the COPY copies the
1635 resource into a collection that is locked with a depth-infinity lock,
1636 then the resource will be added to the lock.
1637
1638 A successful MOVE request on a write locked resource MUST NOT move
1639 the write lock with the resource. However, if there is an existing
1640 lock at the destination, the server MUST add the moved resource to
1641 the destination lock scope. For example, if the MOVE makes the
1642 resource a child of a collection that has a depth-infinity lock, then
1643 the resource will be added to that collection's lock. Additionally,
1644 if a resource with a depth-infinity lock is moved to a destination
1645 that is within the scope of the same lock (e.g., within the URL
1646 namespace tree covered by the lock), the moved resource will again be
1647 added to the lock. In both these examples, as specified in
1648 Section 7.5, an If header must be submitted containing a lock token
1649 for both the source and destination.
1650
16517.7. Refreshing Write Locks
1652
1653 A client MUST NOT submit the same write lock request twice. Note
1654 that a client is always aware it is resubmitting the same lock
1655 request because it must include the lock token in the If header in
1656 order to make the request for a resource that is already locked.
1657
1658 However, a client may submit a LOCK request with an If header but
1659 without a body. A server receiving a LOCK request with no body MUST
1660 NOT create a new lock -- this form of the LOCK request is only to be
1661 used to "refresh" an existing lock (meaning, at minimum, that any
1662 timers associated with the lock MUST be reset).
1663
1664 Clients may submit Timeout headers of arbitrary value with their lock
1665 refresh requests. Servers, as always, may ignore Timeout headers
1666 submitted by the client, and a server MAY refresh a lock with a
1667 timeout period that is different than the previous timeout period
1668 used for the lock, provided it advertises the new value in the LOCK
1669 refresh response.
1670
1671 If an error is received in response to a refresh LOCK request, the
1672 client MUST NOT assume that the lock was refreshed.
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682Dusseault Standards Track [Page 30]
1683
1684RFC 4918 WebDAV June 2007
1685
1686
16878. General Request and Response Handling
1688
16898.1. Precedence in Error Handling
1690
1691 Servers MUST return authorization errors in preference to other
1692 errors. This avoids leaking information about protected resources
1693 (e.g., a client that finds that a hidden resource exists by seeing a
1694 423 Locked response to an anonymous request to the resource).
1695
16968.2. Use of XML
1697
1698 In HTTP/1.1, method parameter information was exclusively encoded in
1699 HTTP headers. Unlike HTTP/1.1, WebDAV encodes method parameter
1700 information either in an XML ([REC-XML]) request entity body, or in
1701 an HTTP header. The use of XML to encode method parameters was
1702 motivated by the ability to add extra XML elements to existing
1703 structures, providing extensibility; and by XML's ability to encode
1704 information in ISO 10646 character sets, providing
1705 internationalization support.
1706
1707 In addition to encoding method parameters, XML is used in WebDAV to
1708 encode the responses from methods, providing the extensibility and
1709 internationalization advantages of XML for method output, as well as
1710 input.
1711
1712 When XML is used for a request or response body, the Content-Type
1713 type SHOULD be application/xml. Implementations MUST accept both
1714 text/xml and application/xml in request and response bodies. Use of
1715 text/xml is deprecated.
1716
1717 All DAV-compliant clients and resources MUST use XML parsers that are
1718 compliant with [REC-XML] and [REC-XML-NAMES]. All XML used in either
1719 requests or responses MUST be, at minimum, well formed and use
1720 namespaces correctly. If a server receives XML that is not well-
1721 formed, then the server MUST reject the entire request with a 400
1722 (Bad Request). If a client receives XML that is not well-formed in a
1723 response, then the client MUST NOT assume anything about the outcome
1724 of the executed method and SHOULD treat the server as malfunctioning.
1725
1726 Note that processing XML submitted by an untrusted source may cause
1727 risks connected to privacy, security, and service quality (see
1728 Section 20). Servers MAY reject questionable requests (even though
1729 they consist of well-formed XML), for instance, with a 400 (Bad
1730 Request) status code and an optional response body explaining the
1731 problem.
1732
1733
1734
1735
1736
1737
1738Dusseault Standards Track [Page 31]
1739
1740RFC 4918 WebDAV June 2007
1741
1742
17438.3. URL Handling
1744
1745 URLs appear in many places in requests and responses.
1746 Interoperability experience with [RFC2518] showed that many clients
1747 parsing Multi-Status responses did not fully implement the full
1748 Reference Resolution defined in Section 5 of [RFC3986]. Thus,
1749 servers in particular need to be careful in handling URLs in
1750 responses, to ensure that clients have enough context to be able to
1751 interpret all the URLs. The rules in this section apply not only to
1752 resource URLs in the 'href' element in Multi-Status responses, but
1753 also to the Destination and If header resource URLs.
1754
1755 The sender has a choice between two approaches: using a relative
1756 reference, which is resolved against the Request-URI, or a full URI.
1757 A server MUST ensure that every 'href' value within a Multi-Status
1758 response uses the same format.
1759
1760 WebDAV only uses one form of relative reference in its extensions,
1761 the absolute path.
1762
1763 Simple-ref = absolute-URI | ( path-absolute [ "?" query ] )
1764
1765 The absolute-URI, path-absolute and query productions are defined in
1766 Sections 4.3, 3.3, and 3.4 of [RFC3986].
1767
1768 Within Simple-ref productions, senders MUST NOT:
1769
1770 o use dot-segments ("." or ".."), or
1771
1772 o have prefixes that do not match the Request-URI (using the
1773 comparison rules defined in Section 3.2.3 of [RFC2616]).
1774
1775 Identifiers for collections SHOULD end in a '/' character.
1776
17778.3.1. Example - Correct URL Handling
1778
1779 Consider the collection http://example.com/sample/ with the internal
1780 member URL http://example.com/sample/a%20test and the PROPFIND
1781 request below:
1782
1783 >>Request:
1784
1785 PROPFIND /sample/ HTTP/1.1
1786 Host: example.com
1787 Depth: 1
1788
1789
1790
1791
1792
1793
1794Dusseault Standards Track [Page 32]
1795
1796RFC 4918 WebDAV June 2007
1797
1798
1799 In this case, the server should return two 'href' elements containing
1800 either
1801
1802 o 'http://example.com/sample/' and
1803 'http://example.com/sample/a%20test', or
1804
1805 o '/sample/' and '/sample/a%20test'
1806
1807 Note that even though the server may be storing the member resource
1808 internally as 'a test', it has to be percent-encoded when used inside
1809 a URI reference (see Section 2.1 of [RFC3986]). Also note that a
1810 legal URI may still contain characters that need to be escaped within
1811 XML character data, such as the ampersand character.
1812
18138.4. Required Bodies in Requests
1814
1815 Some of these new methods do not define bodies. Servers MUST examine
1816 all requests for a body, even when a body was not expected. In cases
1817 where a request body is present but would be ignored by a server, the
1818 server MUST reject the request with 415 (Unsupported Media Type).
1819 This informs the client (which may have been attempting to use an
1820 extension) that the body could not be processed as the client
1821 intended.
1822
18238.5. HTTP Headers for Use in WebDAV
1824
1825 HTTP defines many headers that can be used in WebDAV requests and
1826 responses. Not all of these are appropriate in all situations and
1827 some interactions may be undefined. Note that HTTP 1.1 requires the
1828 Date header in all responses if possible (see Section 14.18,
1829 [RFC2616]).
1830
1831 The server MUST do authorization checks before checking any HTTP
1832 conditional header.
1833
18348.6. ETag
1835
1836 HTTP 1.1 recommends the use of ETags rather than modification dates,
1837 for cache control, and there are even stronger reasons to prefer
1838 ETags for authoring. Correct use of ETags is even more important in
1839 a distributed authoring environment, because ETags are necessary
1840 along with locks to avoid the lost-update problem. A client might
1841 fail to renew a lock, for example, when the lock times out and the
1842 client is accidentally offline or in the middle of a long upload.
1843 When a client fails to renew the lock, it's quite possible the
1844 resource can still be relocked and the user can go on editing, as
1845 long as no changes were made in the meantime. ETags are required for
1846 the client to be able to distinguish this case. Otherwise, the
1847
1848
1849
1850Dusseault Standards Track [Page 33]
1851
1852RFC 4918 WebDAV June 2007
1853
1854
1855 client is forced to ask the user whether to overwrite the resource on
1856 the server without even being able to tell the user if it has
1857 changed. Timestamps do not solve this problem nearly as well as
1858 ETags.
1859
1860 Strong ETags are much more useful for authoring use cases than weak
1861 ETags (see Section 13.3.3 of [RFC2616]). Semantic equivalence can be
1862 a useful concept but that depends on the document type and the
1863 application type, and interoperability might require some agreement
1864 or standard outside the scope of this specification and HTTP. Note
1865 also that weak ETags have certain restrictions in HTTP, e.g., these
1866 cannot be used in If-Match headers.
1867
1868 Note that the meaning of an ETag in a PUT response is not clearly
1869 defined either in this document or in RFC 2616 (i.e., whether the
1870 ETag means that the resource is octet-for-octet equivalent to the
1871 body of the PUT request, or whether the server could have made minor
1872 changes in the formatting or content of the document upon storage).
1873 This is an HTTP issue, not purely a WebDAV issue.
1874
1875 Because clients may be forced to prompt users or throw away changed
1876 content if the ETag changes, a WebDAV server SHOULD NOT change the
1877 ETag (or the Last-Modified time) for a resource that has an unchanged
1878 body and location. The ETag represents the state of the body or
1879 contents of the resource. There is no similar way to tell if
1880 properties have changed.
1881
18828.7. Including Error Response Bodies
1883
1884 HTTP and WebDAV did not use the bodies of most error responses for
1885 machine-parsable information until the specification for Versioning
1886 Extensions to WebDAV introduced a mechanism to include more specific
1887 information in the body of an error response (Section 1.6 of
1888 [RFC3253]). The error body mechanism is appropriate to use with any
1889 error response that may take a body but does not already have a body
1890 defined. The mechanism is particularly appropriate when a status
1891 code can mean many things (for example, 400 Bad Request can mean
1892 required headers are missing, headers are incorrectly formatted, or
1893 much more). This error body mechanism is covered in Section 16.
1894
18958.8. Impact of Namespace Operations on Cache Validators
1896
1897 Note that the HTTP response headers "Etag" and "Last-Modified" (see
1898 [RFC2616], Sections 14.19 and 14.29) are defined per URL (not per
1899 resource), and are used by clients for caching. Therefore servers
1900 must ensure that executing any operation that affects the URL
1901 namespace (such as COPY, MOVE, DELETE, PUT, or MKCOL) does preserve
1902 their semantics, in particular:
1903
1904
1905
1906Dusseault Standards Track [Page 34]
1907
1908RFC 4918 WebDAV June 2007
1909
1910
1911 o For any given URL, the "Last-Modified" value MUST increment every
1912 time the representation returned upon GET changes (within the
1913 limits of timestamp resolution).
1914
1915 o For any given URL, an "ETag" value MUST NOT be reused for
1916 different representations returned by GET.
1917
1918 In practice this means that servers
1919
1920 o might have to increment "Last-Modified" timestamps for every
1921 resource inside the destination namespace of a namespace operation
1922 unless it can do so more selectively, and
1923
1924 o similarly, might have to re-assign "ETag" values for these
1925 resources (unless the server allocates entity tags in a way so
1926 that they are unique across the whole URL namespace managed by the
1927 server).
1928
1929 Note that these considerations also apply to specific use cases, such
1930 as using PUT to create a new resource at a URL that has been mapped
1931 before, but has been deleted since then.
1932
1933 Finally, WebDAV properties (such as DAV:getetag and DAV:
1934 getlastmodified) that inherit their semantics from HTTP headers must
1935 behave accordingly.
1936
19379. HTTP Methods for Distributed Authoring
1938
19399.1. PROPFIND Method
1940
1941 The PROPFIND method retrieves properties defined on the resource
1942 identified by the Request-URI, if the resource does not have any
1943 internal members, or on the resource identified by the Request-URI
1944 and potentially its member resources, if the resource is a collection
1945 that has internal member URLs. All DAV-compliant resources MUST
1946 support the PROPFIND method and the propfind XML element
1947 (Section 14.20) along with all XML elements defined for use with that
1948 element.
1949
1950 A client MUST submit a Depth header with a value of "0", "1", or
1951 "infinity" with a PROPFIND request. Servers MUST support "0" and "1"
1952 depth requests on WebDAV-compliant resources and SHOULD support
1953 "infinity" requests. In practice, support for infinite-depth
1954 requests MAY be disabled, due to the performance and security
1955 concerns associated with this behavior. Servers SHOULD treat a
1956 request without a Depth header as if a "Depth: infinity" header was
1957 included.
1958
1959
1960
1961
1962Dusseault Standards Track [Page 35]
1963
1964RFC 4918 WebDAV June 2007
1965
1966
1967 A client may submit a 'propfind' XML element in the body of the
1968 request method describing what information is being requested. It is
1969 possible to:
1970
1971 o Request particular property values, by naming the properties
1972 desired within the 'prop' element (the ordering of properties in
1973 here MAY be ignored by the server),
1974
1975 o Request property values for those properties defined in this
1976 specification (at a minimum) plus dead properties, by using the
1977 'allprop' element (the 'include' element can be used with
1978 'allprop' to instruct the server to also include additional live
1979 properties that may not have been returned otherwise),
1980
1981 o Request a list of names of all the properties defined on the
1982 resource, by using the 'propname' element.
1983
1984 A client may choose not to submit a request body. An empty PROPFIND
1985 request body MUST be treated as if it were an 'allprop' request.
1986
1987 Note that 'allprop' does not return values for all live properties.
1988 WebDAV servers increasingly have expensively-calculated or lengthy
1989 properties (see [RFC3253] and [RFC3744]) and do not return all
1990 properties already. Instead, WebDAV clients can use propname
1991 requests to discover what live properties exist, and request named
1992 properties when retrieving values. For a live property defined
1993 elsewhere, that definition can specify whether or not that live
1994 property would be returned in 'allprop' requests.
1995
1996 All servers MUST support returning a response of content type text/
1997 xml or application/xml that contains a multistatus XML element that
1998 describes the results of the attempts to retrieve the various
1999 properties.
2000
2001 If there is an error retrieving a property, then a proper error
2002 result MUST be included in the response. A request to retrieve the
2003 value of a property that does not exist is an error and MUST be noted
2004 with a 'response' XML element that contains a 404 (Not Found) status
2005 value.
2006
2007 Consequently, the 'multistatus' XML element for a collection resource
2008 MUST include a 'response' XML element for each member URL of the
2009 collection, to whatever depth was requested. It SHOULD NOT include
2010 any 'response' elements for resources that are not WebDAV-compliant.
2011 Each 'response' element MUST contain an 'href' element that contains
2012 the URL of the resource on which the properties in the prop XML
2013 element are defined. Results for a PROPFIND on a collection resource
2014 are returned as a flat list whose order of entries is not
2015
2016
2017
2018Dusseault Standards Track [Page 36]
2019
2020RFC 4918 WebDAV June 2007
2021
2022
2023 significant. Note that a resource may have only one value for a
2024 property of a given name, so the property may only show up once in
2025 PROPFIND responses.
2026
2027 Properties may be subject to access control. In the case of
2028 'allprop' and 'propname' requests, if a principal does not have the
2029 right to know whether a particular property exists, then the property
2030 MAY be silently excluded from the response.
2031
2032 Some PROPFIND results MAY be cached, with care, as there is no cache
2033 validation mechanism for most properties. This method is both safe
2034 and idempotent (see Section 9.1 of [RFC2616]).
2035
20369.1.1. PROPFIND Status Codes
2037
2038 This section, as with similar sections for other methods, provides
2039 some guidance on error codes and preconditions or postconditions
2040 (defined in Section 16) that might be particularly useful with
2041 PROPFIND.
2042
2043 403 Forbidden - A server MAY reject PROPFIND requests on collections
2044 with depth header of "Infinity", in which case it SHOULD use this
2045 error with the precondition code 'propfind-finite-depth' inside the
2046 error body.
2047
20489.1.2. Status Codes for Use in 'propstat' Element
2049
2050 In PROPFIND responses, information about individual properties is
2051 returned inside 'propstat' elements (see Section 14.22), each
2052 containing an individual 'status' element containing information
2053 about the properties appearing in it. The list below summarizes the
2054 most common status codes used inside 'propstat'; however, clients
2055 should be prepared to handle other 2/3/4/5xx series status codes as
2056 well.
2057
2058 200 OK - A property exists and/or its value is successfully returned.
2059
2060 401 Unauthorized - The property cannot be viewed without appropriate
2061 authorization.
2062
2063 403 Forbidden - The property cannot be viewed regardless of
2064 authentication.
2065
2066 404 Not Found - The property does not exist.
2067
2068
2069
2070
2071
2072
2073
2074Dusseault Standards Track [Page 37]
2075
2076RFC 4918 WebDAV June 2007
2077
2078
20799.1.3. Example - Retrieving Named Properties
2080
2081 >>Request
2082
2083 PROPFIND /file HTTP/1.1
2084 Host: www.example.com
2085 Content-type: application/xml; charset="utf-8"
2086 Content-Length: xxxx
2087
2088 <?xml version="1.0" encoding="utf-8" ?>
2089 <D:propfind xmlns:D="DAV:">
2090 <D:prop xmlns:R="http://ns.example.com/boxschema/">
2091 <R:bigbox/>
2092 <R:author/>
2093 <R:DingALing/>
2094 <R:Random/>
2095 </D:prop>
2096 </D:propfind>
2097
2098
2099 >>Response
2100
2101 HTTP/1.1 207 Multi-Status
2102 Content-Type: application/xml; charset="utf-8"
2103 Content-Length: xxxx
2104
2105 <?xml version="1.0" encoding="utf-8" ?>
2106 <D:multistatus xmlns:D="DAV:">
2107 <D:response xmlns:R="http://ns.example.com/boxschema/">
2108 <D:href>http://www.example.com/file</D:href>
2109 <D:propstat>
2110 <D:prop>
2111 <R:bigbox>
2112 <R:BoxType>Box type A</R:BoxType>
2113 </R:bigbox>
2114 <R:author>
2115 <R:Name>J.J. Johnson</R:Name>
2116 </R:author>
2117 </D:prop>
2118 <D:status>HTTP/1.1 200 OK</D:status>
2119 </D:propstat>
2120 <D:propstat>
2121 <D:prop><R:DingALing/><R:Random/></D:prop>
2122 <D:status>HTTP/1.1 403 Forbidden</D:status>
2123 <D:responsedescription> The user does not have access to the
2124 DingALing property.
2125 </D:responsedescription>
2126 </D:propstat>
2127
2128
2129
2130Dusseault Standards Track [Page 38]
2131
2132RFC 4918 WebDAV June 2007
2133
2134
2135 </D:response>
2136 <D:responsedescription> There has been an access violation error.
2137 </D:responsedescription>
2138 </D:multistatus>
2139
2140
2141 In this example, PROPFIND is executed on a non-collection resource
2142 http://www.example.com/file. The propfind XML element specifies the
2143 name of four properties whose values are being requested. In this
2144 case, only two properties were returned, since the principal issuing
2145 the request did not have sufficient access rights to see the third
2146 and fourth properties.
2147
21489.1.4. Example - Using 'propname' to Retrieve All Property Names
2149
2150 >>Request
2151
2152 PROPFIND /container/ HTTP/1.1
2153 Host: www.example.com
2154 Content-Type: application/xml; charset="utf-8"
2155 Content-Length: xxxx
2156
2157 <?xml version="1.0" encoding="utf-8" ?>
2158 <propfind xmlns="DAV:">
2159 <propname/>
2160 </propfind>
2161
2162
2163 >>Response
2164
2165 HTTP/1.1 207 Multi-Status
2166 Content-Type: application/xml; charset="utf-8"
2167 Content-Length: xxxx
2168
2169 <?xml version="1.0" encoding="utf-8" ?>
2170 <multistatus xmlns="DAV:">
2171 <response>
2172 <href>http://www.example.com/container/</href>
2173 <propstat>
2174 <prop xmlns:R="http://ns.example.com/boxschema/">
2175 <R:bigbox/>
2176 <R:author/>
2177 <creationdate/>
2178 <displayname/>
2179 <resourcetype/>
2180 <supportedlock/>
2181 </prop>
2182 <status>HTTP/1.1 200 OK</status>
2183
2184
2185
2186Dusseault Standards Track [Page 39]
2187
2188RFC 4918 WebDAV June 2007
2189
2190
2191 </propstat>
2192 </response>
2193 <response>
2194 <href>http://www.example.com/container/front.html</href>
2195 <propstat>
2196 <prop xmlns:R="http://ns.example.com/boxschema/">
2197 <R:bigbox/>
2198 <creationdate/>
2199 <displayname/>
2200 <getcontentlength/>
2201 <getcontenttype/>
2202 <getetag/>
2203 <getlastmodified/>
2204 <resourcetype/>
2205 <supportedlock/>
2206 </prop>
2207 <status>HTTP/1.1 200 OK</status>
2208 </propstat>
2209 </response>
2210 </multistatus>
2211
2212 In this example, PROPFIND is invoked on the collection resource
2213 http://www.example.com/container/, with a propfind XML element
2214 containing the propname XML element, meaning the name of all
2215 properties should be returned. Since no Depth header is present, it
2216 assumes its default value of "infinity", meaning the name of the
2217 properties on the collection and all its descendants should be
2218 returned.
2219
2220 Consistent with the previous example, resource
2221 http://www.example.com/container/ has six properties defined on it:
2222 bigbox and author in the "http://ns.example.com/boxschema/"
2223 namespace, and creationdate, displayname, resourcetype, and
2224 supportedlock in the "DAV:" namespace.
2225
2226 The resource http://www.example.com/container/index.html, a member of
2227 the "container" collection, has nine properties defined on it, bigbox
2228 in the "http://ns.example.com/boxschema/" namespace and creationdate,
2229 displayname, getcontentlength, getcontenttype, getetag,
2230 getlastmodified, resourcetype, and supportedlock in the "DAV:"
2231 namespace.
2232
2233 This example also demonstrates the use of XML namespace scoping and
2234 the default namespace. Since the "xmlns" attribute does not contain
2235 a prefix, the namespace applies by default to all enclosed elements.
2236 Hence, all elements that do not explicitly state the namespace to
2237 which they belong are members of the "DAV:" namespace.
2238
2239
2240
2241
2242Dusseault Standards Track [Page 40]
2243
2244RFC 4918 WebDAV June 2007
2245
2246
22479.1.5. Example - Using So-called 'allprop'
2248
2249 Note that 'allprop', despite its name, which remains for backward-
2250 compatibility, does not return every property, but only dead
2251 properties and the live properties defined in this specification.
2252
2253 >>Request
2254
2255 PROPFIND /container/ HTTP/1.1
2256 Host: www.example.com
2257 Depth: 1
2258 Content-Type: application/xml; charset="utf-8"
2259 Content-Length: xxxx
2260
2261 <?xml version="1.0" encoding="utf-8" ?>
2262 <D:propfind xmlns:D="DAV:">
2263 <D:allprop/>
2264 </D:propfind>
2265
2266
2267 >>Response
2268
2269 HTTP/1.1 207 Multi-Status
2270 Content-Type: application/xml; charset="utf-8"
2271 Content-Length: xxxx
2272
2273 <?xml version="1.0" encoding="utf-8" ?>
2274 <D:multistatus xmlns:D="DAV:">
2275 <D:response>
2276 <D:href>/container/</D:href>
2277 <D:propstat>
2278 <D:prop xmlns:R="http://ns.example.com/boxschema/">
2279 <R:bigbox><R:BoxType>Box type A</R:BoxType></R:bigbox>
2280 <R:author><R:Name>Hadrian</R:Name></R:author>
2281 <D:creationdate>1997-12-01T17:42:21-08:00</D:creationdate>
2282 <D:displayname>Example collection</D:displayname>
2283 <D:resourcetype><D:collection/></D:resourcetype>
2284 <D:supportedlock>
2285 <D:lockentry>
2286 <D:lockscope><D:exclusive/></D:lockscope>
2287 <D:locktype><D:write/></D:locktype>
2288 </D:lockentry>
2289 <D:lockentry>
2290 <D:lockscope><D:shared/></D:lockscope>
2291 <D:locktype><D:write/></D:locktype>
2292 </D:lockentry>
2293 </D:supportedlock>
2294 </D:prop>
2295
2296
2297
2298Dusseault Standards Track [Page 41]
2299
2300RFC 4918 WebDAV June 2007
2301
2302
2303 <D:status>HTTP/1.1 200 OK</D:status>
2304 </D:propstat>
2305 </D:response>
2306 <D:response>
2307 <D:href>/container/front.html</D:href>
2308 <D:propstat>
2309 <D:prop xmlns:R="http://ns.example.com/boxschema/">
2310 <R:bigbox><R:BoxType>Box type B</R:BoxType>
2311 </R:bigbox>
2312 <D:creationdate>1997-12-01T18:27:21-08:00</D:creationdate>
2313 <D:displayname>Example HTML resource</D:displayname>
2314 <D:getcontentlength>4525</D:getcontentlength>
2315 <D:getcontenttype>text/html</D:getcontenttype>
2316 <D:getetag>"zzyzx"</D:getetag>
2317 <D:getlastmodified
2318 >Mon, 12 Jan 1998 09:25:56 GMT</D:getlastmodified>
2319 <D:resourcetype/>
2320 <D:supportedlock>
2321 <D:lockentry>
2322 <D:lockscope><D:exclusive/></D:lockscope>
2323 <D:locktype><D:write/></D:locktype>
2324 </D:lockentry>
2325 <D:lockentry>
2326 <D:lockscope><D:shared/></D:lockscope>
2327 <D:locktype><D:write/></D:locktype>
2328 </D:lockentry>
2329 </D:supportedlock>
2330 </D:prop>
2331 <D:status>HTTP/1.1 200 OK</D:status>
2332 </D:propstat>
2333 </D:response>
2334 </D:multistatus>
2335
2336 In this example, PROPFIND was invoked on the resource
2337 http://www.example.com/container/ with a Depth header of 1, meaning
2338 the request applies to the resource and its children, and a propfind
2339 XML element containing the allprop XML element, meaning the request
2340 should return the name and value of all the dead properties defined
2341 on the resources, plus the name and value of all the properties
2342 defined in this specification. This example illustrates the use of
2343 relative references in the 'href' elements of the response.
2344
2345 The resource http://www.example.com/container/ has six properties
2346 defined on it: 'bigbox' and 'author in the
2347 "http://ns.example.com/boxschema/" namespace, DAV:creationdate, DAV:
2348 displayname, DAV:resourcetype, and DAV:supportedlock.
2349
2350
2351
2352
2353
2354Dusseault Standards Track [Page 42]
2355
2356RFC 4918 WebDAV June 2007
2357
2358
2359 The last four properties are WebDAV-specific, defined in Section 15.
2360 Since GET is not supported on this resource, the get* properties
2361 (e.g., DAV:getcontentlength) are not defined on this resource. The
2362 WebDAV-specific properties assert that "container" was created on
2363 December 1, 1997, at 5:42:21PM, in a time zone 8 hours west of GMT
2364 (DAV:creationdate), has a name of "Example collection" (DAV:
2365 displayname), a collection resource type (DAV:resourcetype), and
2366 supports exclusive write and shared write locks (DAV:supportedlock).
2367
2368 The resource http://www.example.com/container/front.html has nine
2369 properties defined on it:
2370
2371 'bigbox' in the "http://ns.example.com/boxschema/" namespace (another
2372 instance of the "bigbox" property type), DAV:creationdate, DAV:
2373 displayname, DAV:getcontentlength, DAV:getcontenttype, DAV:getetag,
2374 DAV:getlastmodified, DAV:resourcetype, and DAV:supportedlock.
2375
2376 The DAV-specific properties assert that "front.html" was created on
2377 December 1, 1997, at 6:27:21PM, in a time zone 8 hours west of GMT
2378 (DAV:creationdate), has a name of "Example HTML resource" (DAV:
2379 displayname), a content length of 4525 bytes (DAV:getcontentlength),
2380 a MIME type of "text/html" (DAV:getcontenttype), an entity tag of
2381 "zzyzx" (DAV:getetag), was last modified on Monday, January 12, 1998,
2382 at 09:25:56 GMT (DAV:getlastmodified), has an empty resource type,
2383 meaning that it is not a collection (DAV:resourcetype), and supports
2384 both exclusive write and shared write locks (DAV:supportedlock).
2385
23869.1.6. Example - Using 'allprop' with 'include'
2387
2388 >>Request
2389
2390 PROPFIND /mycol/ HTTP/1.1
2391 Host: www.example.com
2392 Depth: 1
2393 Content-Type: application/xml; charset="utf-8"
2394 Content-Length: xxxx
2395
2396 <?xml version="1.0" encoding="utf-8" ?>
2397 <D:propfind xmlns:D="DAV:">
2398 <D:allprop/>
2399 <D:include>
2400 <D:supported-live-property-set/>
2401 <D:supported-report-set/>
2402 </D:include>
2403 </D:propfind>
2404
2405
2406
2407
2408
2409
2410Dusseault Standards Track [Page 43]
2411
2412RFC 4918 WebDAV June 2007
2413
2414
2415 In this example, PROPFIND is executed on the resource
2416 http://www.example.com/mycol/ and its internal member resources. The
2417 client requests the values of all live properties defined in this
2418 specification, plus all dead properties, plus two more live
2419 properties defined in [RFC3253]. The response is not shown.
2420
24219.2. PROPPATCH Method
2422
2423 The PROPPATCH method processes instructions specified in the request
2424 body to set and/or remove properties defined on the resource
2425 identified by the Request-URI.
2426
2427 All DAV-compliant resources MUST support the PROPPATCH method and
2428 MUST process instructions that are specified using the
2429 propertyupdate, set, and remove XML elements. Execution of the
2430 directives in this method is, of course, subject to access control
2431 constraints. DAV-compliant resources SHOULD support the setting of
2432 arbitrary dead properties.
2433
2434 The request message body of a PROPPATCH method MUST contain the
2435 propertyupdate XML element.
2436
2437 Servers MUST process PROPPATCH instructions in document order (an
2438 exception to the normal rule that ordering is irrelevant).
2439 Instructions MUST either all be executed or none executed. Thus, if
2440 any error occurs during processing, all executed instructions MUST be
2441 undone and a proper error result returned. Instruction processing
2442 details can be found in the definition of the set and remove
2443 instructions in Sections 14.23 and 14.26.
2444
2445 If a server attempts to make any of the property changes in a
2446 PROPPATCH request (i.e., the request is not rejected for high-level
2447 errors before processing the body), the response MUST be a Multi-
2448 Status response as described in Section 9.2.1.
2449
2450 This method is idempotent, but not safe (see Section 9.1 of
2451 [RFC2616]). Responses to this method MUST NOT be cached.
2452
24539.2.1. Status Codes for Use in 'propstat' Element
2454
2455 In PROPPATCH responses, information about individual properties is
2456 returned inside 'propstat' elements (see Section 14.22), each
2457 containing an individual 'status' element containing information
2458 about the properties appearing in it. The list below summarizes the
2459 most common status codes used inside 'propstat'; however, clients
2460 should be prepared to handle other 2/3/4/5xx series status codes as
2461 well.
2462
2463
2464
2465
2466Dusseault Standards Track [Page 44]
2467
2468RFC 4918 WebDAV June 2007
2469
2470
2471 200 (OK) - The property set or change succeeded. Note that if this
2472 appears for one property, it appears for every property in the
2473 response, due to the atomicity of PROPPATCH.
2474
2475 403 (Forbidden) - The client, for reasons the server chooses not to
2476 specify, cannot alter one of the properties.
2477
2478 403 (Forbidden): The client has attempted to set a protected
2479 property, such as DAV:getetag. If returning this error, the server
2480 SHOULD use the precondition code 'cannot-modify-protected-property'
2481 inside the response body.
2482
2483 409 (Conflict) - The client has provided a value whose semantics are
2484 not appropriate for the property.
2485
2486 424 (Failed Dependency) - The property change could not be made
2487 because of another property change that failed.
2488
2489 507 (Insufficient Storage) - The server did not have sufficient space
2490 to record the property.
2491
24929.2.2. Example - PROPPATCH
2493
2494 >>Request
2495
2496 PROPPATCH /bar.html HTTP/1.1
2497 Host: www.example.com
2498 Content-Type: application/xml; charset="utf-8"
2499 Content-Length: xxxx
2500
2501 <?xml version="1.0" encoding="utf-8" ?>
2502 <D:propertyupdate xmlns:D="DAV:"
2503 xmlns:Z="http://ns.example.com/standards/z39.50/">
2504 <D:set>
2505 <D:prop>
2506 <Z:Authors>
2507 <Z:Author>Jim Whitehead</Z:Author>
2508 <Z:Author>Roy Fielding</Z:Author>
2509 </Z:Authors>
2510 </D:prop>
2511 </D:set>
2512 <D:remove>
2513 <D:prop><Z:Copyright-Owner/></D:prop>
2514 </D:remove>
2515 </D:propertyupdate>
2516
2517
2518
2519
2520
2521
2522Dusseault Standards Track [Page 45]
2523
2524RFC 4918 WebDAV June 2007
2525
2526
2527 >>Response
2528
2529 HTTP/1.1 207 Multi-Status
2530 Content-Type: application/xml; charset="utf-8"
2531 Content-Length: xxxx
2532
2533 <?xml version="1.0" encoding="utf-8" ?>
2534 <D:multistatus xmlns:D="DAV:"
2535 xmlns:Z="http://ns.example.com/standards/z39.50/">
2536 <D:response>
2537 <D:href>http://www.example.com/bar.html</D:href>
2538 <D:propstat>
2539 <D:prop><Z:Authors/></D:prop>
2540 <D:status>HTTP/1.1 424 Failed Dependency</D:status>
2541 </D:propstat>
2542 <D:propstat>
2543 <D:prop><Z:Copyright-Owner/></D:prop>
2544 <D:status>HTTP/1.1 409 Conflict</D:status>
2545 </D:propstat>
2546 <D:responsedescription> Copyright Owner cannot be deleted or
2547 altered.</D:responsedescription>
2548 </D:response>
2549 </D:multistatus>
2550
2551 In this example, the client requests the server to set the value of
2552 the "Authors" property in the
2553 "http://ns.example.com/standards/z39.50/" namespace, and to remove
2554 the property "Copyright-Owner" in the same namespace. Since the
2555 Copyright-Owner property could not be removed, no property
2556 modifications occur. The 424 (Failed Dependency) status code for the
2557 Authors property indicates this action would have succeeded if it
2558 were not for the conflict with removing the Copyright-Owner property.
2559
25609.3. MKCOL Method
2561
2562 MKCOL creates a new collection resource at the location specified by
2563 the Request-URI. If the Request-URI is already mapped to a resource,
2564 then the MKCOL MUST fail. During MKCOL processing, a server MUST
2565 make the Request-URI an internal member of its parent collection,
2566 unless the Request-URI is "/". If no such ancestor exists, the
2567 method MUST fail. When the MKCOL operation creates a new collection
2568 resource, all ancestors MUST already exist, or the method MUST fail
2569 with a 409 (Conflict) status code. For example, if a request to
2570 create collection /a/b/c/d/ is made, and /a/b/c/ does not exist, the
2571 request must fail.
2572
2573 When MKCOL is invoked without a request body, the newly created
2574 collection SHOULD have no members.
2575
2576
2577
2578Dusseault Standards Track [Page 46]
2579
2580RFC 4918 WebDAV June 2007
2581
2582
2583 A MKCOL request message may contain a message body. The precise
2584 behavior of a MKCOL request when the body is present is undefined,
2585 but limited to creating collections, members of a collection, bodies
2586 of members, and properties on the collections or members. If the
2587 server receives a MKCOL request entity type it does not support or
2588 understand, it MUST respond with a 415 (Unsupported Media Type)
2589 status code. If the server decides to reject the request based on
2590 the presence of an entity or the type of an entity, it should use the
2591 415 (Unsupported Media Type) status code.
2592
2593 This method is idempotent, but not safe (see Section 9.1 of
2594 [RFC2616]). Responses to this method MUST NOT be cached.
2595
25969.3.1. MKCOL Status Codes
2597
2598 In addition to the general status codes possible, the following
2599 status codes have specific applicability to MKCOL:
2600
2601 201 (Created) - The collection was created.
2602
2603 403 (Forbidden) - This indicates at least one of two conditions: 1)
2604 the server does not allow the creation of collections at the given
2605 location in its URL namespace, or 2) the parent collection of the
2606 Request-URI exists but cannot accept members.
2607
2608 405 (Method Not Allowed) - MKCOL can only be executed on an unmapped
2609 URL.
2610
2611 409 (Conflict) - A collection cannot be made at the Request-URI until
2612 one or more intermediate collections have been created. The server
2613 MUST NOT create those intermediate collections automatically.
2614
2615 415 (Unsupported Media Type) - The server does not support the
2616 request body type (although bodies are legal on MKCOL requests, since
2617 this specification doesn't define any, the server is likely not to
2618 support any given body type).
2619
2620 507 (Insufficient Storage) - The resource does not have sufficient
2621 space to record the state of the resource after the execution of this
2622 method.
2623
26249.3.2. Example - MKCOL
2625
2626 This example creates a collection called /webdisc/xfiles/ on the
2627 server www.example.com.
2628
2629
2630
2631
2632
2633
2634Dusseault Standards Track [Page 47]
2635
2636RFC 4918 WebDAV June 2007
2637
2638
2639 >>Request
2640
2641 MKCOL /webdisc/xfiles/ HTTP/1.1
2642 Host: www.example.com
2643
2644
2645 >>Response
2646
2647 HTTP/1.1 201 Created
2648
26499.4. GET, HEAD for Collections
2650
2651 The semantics of GET are unchanged when applied to a collection,
2652 since GET is defined as, "retrieve whatever information (in the form
2653 of an entity) is identified by the Request-URI" [RFC2616]. GET, when
2654 applied to a collection, may return the contents of an "index.html"
2655 resource, a human-readable view of the contents of the collection, or
2656 something else altogether. Hence, it is possible that the result of
2657 a GET on a collection will bear no correlation to the membership of
2658 the collection.
2659
2660 Similarly, since the definition of HEAD is a GET without a response
2661 message body, the semantics of HEAD are unmodified when applied to
2662 collection resources.
2663
26649.5. POST for Collections
2665
2666 Since by definition the actual function performed by POST is
2667 determined by the server and often depends on the particular
2668 resource, the behavior of POST when applied to collections cannot be
2669 meaningfully modified because it is largely undefined. Thus, the
2670 semantics of POST are unmodified when applied to a collection.
2671
26729.6. DELETE Requirements
2673
2674 DELETE is defined in [RFC2616], Section 9.7, to "delete the resource
2675 identified by the Request-URI". However, WebDAV changes some DELETE
2676 handling requirements.
2677
2678 A server processing a successful DELETE request:
2679
2680 MUST destroy locks rooted on the deleted resource
2681
2682 MUST remove the mapping from the Request-URI to any resource.
2683
2684 Thus, after a successful DELETE operation (and in the absence of
2685 other actions), a subsequent GET/HEAD/PROPFIND request to the target
2686 Request-URI MUST return 404 (Not Found).
2687
2688
2689
2690Dusseault Standards Track [Page 48]
2691
2692RFC 4918 WebDAV June 2007
2693
2694
26959.6.1. DELETE for Collections
2696
2697 The DELETE method on a collection MUST act as if a "Depth: infinity"
2698 header was used on it. A client MUST NOT submit a Depth header with
2699 a DELETE on a collection with any value but infinity.
2700
2701 DELETE instructs that the collection specified in the Request-URI and
2702 all resources identified by its internal member URLs are to be
2703 deleted.
2704
2705 If any resource identified by a member URL cannot be deleted, then
2706 all of the member's ancestors MUST NOT be deleted, so as to maintain
2707 URL namespace consistency.
2708
2709 Any headers included with DELETE MUST be applied in processing every
2710 resource to be deleted.
2711
2712 When the DELETE method has completed processing, it MUST result in a
2713 consistent URL namespace.
2714
2715 If an error occurs deleting a member resource (a resource other than
2716 the resource identified in the Request-URI), then the response can be
2717 a 207 (Multi-Status). Multi-Status is used here to indicate which
2718 internal resources could NOT be deleted, including an error code,
2719 which should help the client understand which resources caused the
2720 failure. For example, the Multi-Status body could include a response
2721 with status 423 (Locked) if an internal resource was locked.
2722
2723 The server MAY return a 4xx status response, rather than a 207, if
2724 the request failed completely.
2725
2726 424 (Failed Dependency) status codes SHOULD NOT be in the 207 (Multi-
2727 Status) response for DELETE. They can be safely left out because the
2728 client will know that the ancestors of a resource could not be
2729 deleted when the client receives an error for the ancestor's progeny.
2730 Additionally, 204 (No Content) errors SHOULD NOT be returned in the
2731 207 (Multi-Status). The reason for this prohibition is that 204 (No
2732 Content) is the default success code.
2733
27349.6.2. Example - DELETE
2735
2736 >>Request
2737
2738 DELETE /container/ HTTP/1.1
2739 Host: www.example.com
2740
2741
2742
2743
2744
2745
2746Dusseault Standards Track [Page 49]
2747
2748RFC 4918 WebDAV June 2007
2749
2750
2751 >>Response
2752
2753 HTTP/1.1 207 Multi-Status
2754 Content-Type: application/xml; charset="utf-8"
2755 Content-Length: xxxx
2756
2757 <?xml version="1.0" encoding="utf-8" ?>
2758 <d:multistatus xmlns:d="DAV:">
2759 <d:response>
2760 <d:href>http://www.example.com/container/resource3</d:href>
2761 <d:status>HTTP/1.1 423 Locked</d:status>
2762 <d:error><d:lock-token-submitted/></d:error>
2763 </d:response>
2764 </d:multistatus>
2765
2766 In this example, the attempt to delete
2767 http://www.example.com/container/resource3 failed because it is
2768 locked, and no lock token was submitted with the request.
2769 Consequently, the attempt to delete http://www.example.com/container/
2770 also failed. Thus, the client knows that the attempt to delete
2771 http://www.example.com/container/ must have also failed since the
2772 parent cannot be deleted unless its child has also been deleted.
2773 Even though a Depth header has not been included, a depth of infinity
2774 is assumed because the method is on a collection.
2775
27769.7. PUT Requirements
2777
27789.7.1. PUT for Non-Collection Resources
2779
2780 A PUT performed on an existing resource replaces the GET response
2781 entity of the resource. Properties defined on the resource may be
2782 recomputed during PUT processing but are not otherwise affected. For
2783 example, if a server recognizes the content type of the request body,
2784 it may be able to automatically extract information that could be
2785 profitably exposed as properties.
2786
2787 A PUT that would result in the creation of a resource without an
2788 appropriately scoped parent collection MUST fail with a 409
2789 (Conflict).
2790
2791 A PUT request allows a client to indicate what media type an entity
2792 body has, and whether it should change if overwritten. Thus, a
2793 client SHOULD provide a Content-Type for a new resource if any is
2794 known. If the client does not provide a Content-Type for a new
2795 resource, the server MAY create a resource with no Content-Type
2796 assigned, or it MAY attempt to assign a Content-Type.
2797
2798
2799
2800
2801
2802Dusseault Standards Track [Page 50]
2803
2804RFC 4918 WebDAV June 2007
2805
2806
2807 Note that although a recipient ought generally to treat metadata
2808 supplied with an HTTP request as authoritative, in practice there's
2809 no guarantee that a server will accept client-supplied metadata
2810 (e.g., any request header beginning with "Content-"). Many servers
2811 do not allow configuring the Content-Type on a per-resource basis in
2812 the first place. Thus, clients can't always rely on the ability to
2813 directly influence the content type by including a Content-Type
2814 request header.
2815
28169.7.2. PUT for Collections
2817
2818 This specification does not define the behavior of the PUT method for
2819 existing collections. A PUT request to an existing collection MAY be
2820 treated as an error (405 Method Not Allowed).
2821
2822 The MKCOL method is defined to create collections.
2823
28249.8. COPY Method
2825
2826 The COPY method creates a duplicate of the source resource identified
2827 by the Request-URI, in the destination resource identified by the URI
2828 in the Destination header. The Destination header MUST be present.
2829 The exact behavior of the COPY method depends on the type of the
2830 source resource.
2831
2832 All WebDAV-compliant resources MUST support the COPY method.
2833 However, support for the COPY method does not guarantee the ability
2834 to copy a resource. For example, separate programs may control
2835 resources on the same server. As a result, it may not be possible to
2836 copy a resource to a location that appears to be on the same server.
2837
2838 This method is idempotent, but not safe (see Section 9.1 of
2839 [RFC2616]). Responses to this method MUST NOT be cached.
2840
28419.8.1. COPY for Non-collection Resources
2842
2843 When the source resource is not a collection, the result of the COPY
2844 method is the creation of a new resource at the destination whose
2845 state and behavior match that of the source resource as closely as
2846 possible. Since the environment at the destination may be different
2847 than at the source due to factors outside the scope of control of the
2848 server, such as the absence of resources required for correct
2849 operation, it may not be possible to completely duplicate the
2850 behavior of the resource at the destination. Subsequent alterations
2851 to the destination resource will not modify the source resource.
2852 Subsequent alterations to the source resource will not modify the
2853 destination resource.
2854
2855
2856
2857
2858Dusseault Standards Track [Page 51]
2859
2860RFC 4918 WebDAV June 2007
2861
2862
28639.8.2. COPY for Properties
2864
2865 After a successful COPY invocation, all dead properties on the source
2866 resource SHOULD be duplicated on the destination resource. Live
2867 properties described in this document SHOULD be duplicated as
2868 identically behaving live properties at the destination resource, but
2869 not necessarily with the same values. Servers SHOULD NOT convert
2870 live properties into dead properties on the destination resource,
2871 because clients may then draw incorrect conclusions about the state
2872 or functionality of a resource. Note that some live properties are
2873 defined such that the absence of the property has a specific meaning
2874 (e.g., a flag with one meaning if present, and the opposite if
2875 absent), and in these cases, a successful COPY might result in the
2876 property being reported as "Not Found" in subsequent requests.
2877
2878 When the destination is an unmapped URL, a COPY operation creates a
2879 new resource much like a PUT operation does. Live properties that
2880 are related to resource creation (such as DAV:creationdate) should
2881 have their values set accordingly.
2882
28839.8.3. COPY for Collections
2884
2885 The COPY method on a collection without a Depth header MUST act as if
2886 a Depth header with value "infinity" was included. A client may
2887 submit a Depth header on a COPY on a collection with a value of "0"
2888 or "infinity". Servers MUST support the "0" and "infinity" Depth
2889 header behaviors on WebDAV-compliant resources.
2890
2891 An infinite-depth COPY instructs that the collection resource
2892 identified by the Request-URI is to be copied to the location
2893 identified by the URI in the Destination header, and all its internal
2894 member resources are to be copied to a location relative to it,
2895 recursively through all levels of the collection hierarchy. Note
2896 that an infinite-depth COPY of /A/ into /A/B/ could lead to infinite
2897 recursion if not handled correctly.
2898
2899 A COPY of "Depth: 0" only instructs that the collection and its
2900 properties, but not resources identified by its internal member URLs,
2901 are to be copied.
2902
2903 Any headers included with a COPY MUST be applied in processing every
2904 resource to be copied with the exception of the Destination header.
2905
2906 The Destination header only specifies the destination URI for the
2907 Request-URI. When applied to members of the collection identified by
2908 the Request-URI, the value of Destination is to be modified to
2909 reflect the current location in the hierarchy. So, if the Request-
2910 URI is /a/ with Host header value http://example.com/ and the
2911
2912
2913
2914Dusseault Standards Track [Page 52]
2915
2916RFC 4918 WebDAV June 2007
2917
2918
2919 Destination is http://example.com/b/, then when
2920 http://example.com/a/c/d is processed, it must use a Destination of
2921 http://example.com/b/c/d.
2922
2923 When the COPY method has completed processing, it MUST have created a
2924 consistent URL namespace at the destination (see Section 5.1 for the
2925 definition of namespace consistency). However, if an error occurs
2926 while copying an internal collection, the server MUST NOT copy any
2927 resources identified by members of this collection (i.e., the server
2928 must skip this subtree), as this would create an inconsistent
2929 namespace. After detecting an error, the COPY operation SHOULD try
2930 to finish as much of the original copy operation as possible (i.e.,
2931 the server should still attempt to copy other subtrees and their
2932 members that are not descendants of an error-causing collection).
2933
2934 So, for example, if an infinite-depth copy operation is performed on
2935 collection /a/, which contains collections /a/b/ and /a/c/, and an
2936 error occurs copying /a/b/, an attempt should still be made to copy
2937 /a/c/. Similarly, after encountering an error copying a non-
2938 collection resource as part of an infinite-depth copy, the server
2939 SHOULD try to finish as much of the original copy operation as
2940 possible.
2941
2942 If an error in executing the COPY method occurs with a resource other
2943 than the resource identified in the Request-URI, then the response
2944 MUST be a 207 (Multi-Status), and the URL of the resource causing the
2945 failure MUST appear with the specific error.
2946
2947 The 424 (Failed Dependency) status code SHOULD NOT be returned in the
2948 207 (Multi-Status) response from a COPY method. These responses can
2949 be safely omitted because the client will know that the progeny of a
2950 resource could not be copied when the client receives an error for
2951 the parent. Additionally, 201 (Created)/204 (No Content) status
2952 codes SHOULD NOT be returned as values in 207 (Multi-Status)
2953 responses from COPY methods. They, too, can be safely omitted
2954 because they are the default success codes.
2955
29569.8.4. COPY and Overwriting Destination Resources
2957
2958 If a COPY request has an Overwrite header with a value of "F", and a
2959 resource exists at the Destination URL, the server MUST fail the
2960 request.
2961
2962 When a server executes a COPY request and overwrites a destination
2963 resource, the exact behavior MAY depend on many factors, including
2964 WebDAV extension capabilities (see particularly [RFC3253]). For
2965
2966
2967
2968
2969
2970Dusseault Standards Track [Page 53]
2971
2972RFC 4918 WebDAV June 2007
2973
2974
2975 example, when an ordinary resource is overwritten, the server could
2976 delete the target resource before doing the copy, or could do an in-
2977 place overwrite to preserve live properties.
2978
2979 When a collection is overwritten, the membership of the destination
2980 collection after the successful COPY request MUST be the same
2981 membership as the source collection immediately before the COPY.
2982 Thus, merging the membership of the source and destination
2983 collections together in the destination is not a compliant behavior.
2984
2985 In general, if clients require the state of the destination URL to be
2986 wiped out prior to a COPY (e.g., to force live properties to be
2987 reset), then the client could send a DELETE to the destination before
2988 the COPY request to ensure this reset.
2989
29909.8.5. Status Codes
2991
2992 In addition to the general status codes possible, the following
2993 status codes have specific applicability to COPY:
2994
2995 201 (Created) - The source resource was successfully copied. The
2996 COPY operation resulted in the creation of a new resource.
2997
2998 204 (No Content) - The source resource was successfully copied to a
2999 preexisting destination resource.
3000
3001 207 (Multi-Status) - Multiple resources were to be affected by the
3002 COPY, but errors on some of them prevented the operation from taking
3003 place. Specific error messages, together with the most appropriate
3004 of the source and destination URLs, appear in the body of the multi-
3005 status response. For example, if a destination resource was locked
3006 and could not be overwritten, then the destination resource URL
3007 appears with the 423 (Locked) status.
3008
3009 403 (Forbidden) - The operation is forbidden. A special case for
3010 COPY could be that the source and destination resources are the same
3011 resource.
3012
3013 409 (Conflict) - A resource cannot be created at the destination
3014 until one or more intermediate collections have been created. The
3015 server MUST NOT create those intermediate collections automatically.
3016
3017 412 (Precondition Failed) - A precondition header check failed, e.g.,
3018 the Overwrite header is "F" and the destination URL is already mapped
3019 to a resource.
3020
3021
3022
3023
3024
3025
3026Dusseault Standards Track [Page 54]
3027
3028RFC 4918 WebDAV June 2007
3029
3030
3031 423 (Locked) - The destination resource, or resource within the
3032 destination collection, was locked. This response SHOULD contain the
3033 'lock-token-submitted' precondition element.
3034
3035 502 (Bad Gateway) - This may occur when the destination is on another
3036 server, repository, or URL namespace. Either the source namespace
3037 does not support copying to the destination namespace, or the
3038 destination namespace refuses to accept the resource. The client may
3039 wish to try GET/PUT and PROPFIND/PROPPATCH instead.
3040
3041 507 (Insufficient Storage) - The destination resource does not have
3042 sufficient space to record the state of the resource after the
3043 execution of this method.
3044
30459.8.6. Example - COPY with Overwrite
3046
3047 This example shows resource
3048 http://www.example.com/~fielding/index.html being copied to the
3049 location http://www.example.com/users/f/fielding/index.html. The 204
3050 (No Content) status code indicates that the existing resource at the
3051 destination was overwritten.
3052
3053 >>Request
3054
3055 COPY /~fielding/index.html HTTP/1.1
3056 Host: www.example.com
3057 Destination: http://www.example.com/users/f/fielding/index.html
3058
3059 >>Response
3060
3061 HTTP/1.1 204 No Content
3062
30639.8.7. Example - COPY with No Overwrite
3064
3065 The following example shows the same copy operation being performed,
3066 but with the Overwrite header set to "F." A response of 412
3067 (Precondition Failed) is returned because the destination URL is
3068 already mapped to a resource.
3069
3070 >>Request
3071
3072 COPY /~fielding/index.html HTTP/1.1
3073 Host: www.example.com
3074 Destination: http://www.example.com/users/f/fielding/index.html
3075 Overwrite: F
3076
3077
3078
3079
3080
3081
3082Dusseault Standards Track [Page 55]
3083
3084RFC 4918 WebDAV June 2007
3085
3086
3087 >>Response
3088
3089 HTTP/1.1 412 Precondition Failed
3090
30919.8.8. Example - COPY of a Collection
3092
3093 >>Request
3094
3095 COPY /container/ HTTP/1.1
3096 Host: www.example.com
3097 Destination: http://www.example.com/othercontainer/
3098 Depth: infinity
3099
3100 >>Response
3101
3102 HTTP/1.1 207 Multi-Status
3103 Content-Type: application/xml; charset="utf-8"
3104 Content-Length: xxxx
3105
3106 <?xml version="1.0" encoding="utf-8" ?>
3107
3108 <d:multistatus xmlns:d="DAV:">
3109 <d:response>
3110 <d:href>http://www.example.com/othercontainer/R2/</d:href>
3111 <d:status>HTTP/1.1 423 Locked</d:status>
3112 <d:error><d:lock-token-submitted/></d:error>
3113 </d:response>
3114 </d:multistatus>
3115
3116 The Depth header is unnecessary as the default behavior of COPY on a
3117 collection is to act as if a "Depth: infinity" header had been
3118 submitted. In this example, most of the resources, along with the
3119 collection, were copied successfully. However, the collection R2
3120 failed because the destination R2 is locked. Because there was an
3121 error copying R2, none of R2's members were copied. However, no
3122 errors were listed for those members due to the error minimization
3123 rules.
3124
31259.9. MOVE Method
3126
3127 The MOVE operation on a non-collection resource is the logical
3128 equivalent of a copy (COPY), followed by consistency maintenance
3129 processing, followed by a delete of the source, where all three
3130 actions are performed in a single operation. The consistency
3131 maintenance step allows the server to perform updates caused by the
3132 move, such as updating all URLs, other than the Request-URI that
3133 identifies the source resource, to point to the new destination
3134 resource.
3135
3136
3137
3138Dusseault Standards Track [Page 56]
3139
3140RFC 4918 WebDAV June 2007
3141
3142
3143 The Destination header MUST be present on all MOVE methods and MUST
3144 follow all COPY requirements for the COPY part of the MOVE method.
3145 All WebDAV-compliant resources MUST support the MOVE method.
3146
3147 Support for the MOVE method does not guarantee the ability to move a
3148 resource to a particular destination. For example, separate programs
3149 may actually control different sets of resources on the same server.
3150 Therefore, it may not be possible to move a resource within a
3151 namespace that appears to belong to the same server.
3152
3153 If a resource exists at the destination, the destination resource
3154 will be deleted as a side-effect of the MOVE operation, subject to
3155 the restrictions of the Overwrite header.
3156
3157 This method is idempotent, but not safe (see Section 9.1 of
3158 [RFC2616]). Responses to this method MUST NOT be cached.
3159
31609.9.1. MOVE for Properties
3161
3162 Live properties described in this document SHOULD be moved along with
3163 the resource, such that the resource has identically behaving live
3164 properties at the destination resource, but not necessarily with the
3165 same values. Note that some live properties are defined such that
3166 the absence of the property has a specific meaning (e.g., a flag with
3167 one meaning if present, and the opposite if absent), and in these
3168 cases, a successful MOVE might result in the property being reported
3169 as "Not Found" in subsequent requests. If the live properties will
3170 not work the same way at the destination, the server MAY fail the
3171 request.
3172
3173 MOVE is frequently used by clients to rename a file without changing
3174 its parent collection, so it's not appropriate to reset all live
3175 properties that are set at resource creation. For example, the DAV:
3176 creationdate property value SHOULD remain the same after a MOVE.
3177
3178 Dead properties MUST be moved along with the resource.
3179
31809.9.2. MOVE for Collections
3181
3182 A MOVE with "Depth: infinity" instructs that the collection
3183 identified by the Request-URI be moved to the address specified in
3184 the Destination header, and all resources identified by its internal
3185 member URLs are to be moved to locations relative to it, recursively
3186 through all levels of the collection hierarchy.
3187
3188 The MOVE method on a collection MUST act as if a "Depth: infinity"
3189 header was used on it. A client MUST NOT submit a Depth header on a
3190 MOVE on a collection with any value but "infinity".
3191
3192
3193
3194Dusseault Standards Track [Page 57]
3195
3196RFC 4918 WebDAV June 2007
3197
3198
3199 Any headers included with MOVE MUST be applied in processing every
3200 resource to be moved with the exception of the Destination header.
3201 The behavior of the Destination header is the same as given for COPY
3202 on collections.
3203
3204 When the MOVE method has completed processing, it MUST have created a
3205 consistent URL namespace at both the source and destination (see
3206 Section 5.1 for the definition of namespace consistency). However,
3207 if an error occurs while moving an internal collection, the server
3208 MUST NOT move any resources identified by members of the failed
3209 collection (i.e., the server must skip the error-causing subtree), as
3210 this would create an inconsistent namespace. In this case, after
3211 detecting the error, the move operation SHOULD try to finish as much
3212 of the original move as possible (i.e., the server should still
3213 attempt to move other subtrees and the resources identified by their
3214 members that are not descendants of an error-causing collection).
3215 So, for example, if an infinite-depth move is performed on collection
3216 /a/, which contains collections /a/b/ and /a/c/, and an error occurs
3217 moving /a/b/, an attempt should still be made to try moving /a/c/.
3218 Similarly, after encountering an error moving a non-collection
3219 resource as part of an infinite-depth move, the server SHOULD try to
3220 finish as much of the original move operation as possible.
3221
3222 If an error occurs with a resource other than the resource identified
3223 in the Request-URI, then the response MUST be a 207 (Multi-Status),
3224 and the errored resource's URL MUST appear with the specific error.
3225
3226 The 424 (Failed Dependency) status code SHOULD NOT be returned in the
3227 207 (Multi-Status) response from a MOVE method. These errors can be
3228 safely omitted because the client will know that the progeny of a
3229 resource could not be moved when the client receives an error for the
3230 parent. Additionally, 201 (Created)/204 (No Content) responses
3231 SHOULD NOT be returned as values in 207 (Multi-Status) responses from
3232 a MOVE. These responses can be safely omitted because they are the
3233 default success codes.
3234
32359.9.3. MOVE and the Overwrite Header
3236
3237 If a resource exists at the destination and the Overwrite header is
3238 "T", then prior to performing the move, the server MUST perform a
3239 DELETE with "Depth: infinity" on the destination resource. If the
3240 Overwrite header is set to "F", then the operation will fail.
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250Dusseault Standards Track [Page 58]
3251
3252RFC 4918 WebDAV June 2007
3253
3254
32559.9.4. Status Codes
3256
3257 In addition to the general status codes possible, the following
3258 status codes have specific applicability to MOVE:
3259
3260 201 (Created) - The source resource was successfully moved, and a new
3261 URL mapping was created at the destination.
3262
3263 204 (No Content) - The source resource was successfully moved to a
3264 URL that was already mapped.
3265
3266 207 (Multi-Status) - Multiple resources were to be affected by the
3267 MOVE, but errors on some of them prevented the operation from taking
3268 place. Specific error messages, together with the most appropriate
3269 of the source and destination URLs, appear in the body of the multi-
3270 status response. For example, if a source resource was locked and
3271 could not be moved, then the source resource URL appears with the 423
3272 (Locked) status.
3273
3274 403 (Forbidden) - Among many possible reasons for forbidding a MOVE
3275 operation, this status code is recommended for use when the source
3276 and destination resources are the same.
3277
3278 409 (Conflict) - A resource cannot be created at the destination
3279 until one or more intermediate collections have been created. The
3280 server MUST NOT create those intermediate collections automatically.
3281 Or, the server was unable to preserve the behavior of the live
3282 properties and still move the resource to the destination (see
3283 'preserved-live-properties' postcondition).
3284
3285 412 (Precondition Failed) - A condition header failed. Specific to
3286 MOVE, this could mean that the Overwrite header is "F" and the
3287 destination URL is already mapped to a resource.
3288
3289 423 (Locked) - The source or the destination resource, the source or
3290 destination resource parent, or some resource within the source or
3291 destination collection, was locked. This response SHOULD contain the
3292 'lock-token-submitted' precondition element.
3293
3294 502 (Bad Gateway) - This may occur when the destination is on another
3295 server and the destination server refuses to accept the resource.
3296 This could also occur when the destination is on another sub-section
3297 of the same server namespace.
3298
3299
3300
3301
3302
3303
3304
3305
3306Dusseault Standards Track [Page 59]
3307
3308RFC 4918 WebDAV June 2007
3309
3310
33119.9.5. Example - MOVE of a Non-Collection
3312
3313 This example shows resource
3314 http://www.example.com/~fielding/index.html being moved to the
3315 location http://www.example.com/users/f/fielding/index.html. The
3316 contents of the destination resource would have been overwritten if
3317 the destination URL was already mapped to a resource. In this case,
3318 since there was nothing at the destination resource, the response
3319 code is 201 (Created).
3320
3321 >>Request
3322
3323 MOVE /~fielding/index.html HTTP/1.1
3324 Host: www.example.com
3325 Destination: http://www.example/users/f/fielding/index.html
3326
3327 >>Response
3328
3329 HTTP/1.1 201 Created
3330 Location: http://www.example.com/users/f/fielding/index.html
3331
33329.9.6. Example - MOVE of a Collection
3333
3334 >>Request
3335
3336 MOVE /container/ HTTP/1.1
3337 Host: www.example.com
3338 Destination: http://www.example.com/othercontainer/
3339 Overwrite: F
3340 If: (<urn:uuid:fe184f2e-6eec-41d0-c765-01adc56e6bb4>)
3341 (<urn:uuid:e454f3f3-acdc-452a-56c7-00a5c91e4b77>)
3342
3343 >>Response
3344
3345 HTTP/1.1 207 Multi-Status
3346 Content-Type: application/xml; charset="utf-8"
3347 Content-Length: xxxx
3348
3349 <?xml version="1.0" encoding="utf-8" ?>
3350 <d:multistatus xmlns:d='DAV:'>
3351 <d:response>
3352 <d:href>http://www.example.com/othercontainer/C2/</d:href>
3353 <d:status>HTTP/1.1 423 Locked</d:status>
3354 <d:error><d:lock-token-submitted/></d:error>
3355 </d:response>
3356 </d:multistatus>
3357
3358
3359
3360
3361
3362Dusseault Standards Track [Page 60]
3363
3364RFC 4918 WebDAV June 2007
3365
3366
3367 In this example, the client has submitted a number of lock tokens
3368 with the request. A lock token will need to be submitted for every
3369 resource, both source and destination, anywhere in the scope of the
3370 method, that is locked. In this case, the proper lock token was not
3371 submitted for the destination
3372 http://www.example.com/othercontainer/C2/. This means that the
3373 resource /container/C2/ could not be moved. Because there was an
3374 error moving /container/C2/, none of /container/C2's members were
3375 moved. However, no errors were listed for those members due to the
3376 error minimization rules. User agent authentication has previously
3377 occurred via a mechanism outside the scope of the HTTP protocol, in
3378 an underlying transport layer.
3379
33809.10. LOCK Method
3381
3382 The following sections describe the LOCK method, which is used to
3383 take out a lock of any access type and to refresh an existing lock.
3384 These sections on the LOCK method describe only those semantics that
3385 are specific to the LOCK method and are independent of the access
3386 type of the lock being requested.
3387
3388 Any resource that supports the LOCK method MUST, at minimum, support
3389 the XML request and response formats defined herein.
3390
3391 This method is neither idempotent nor safe (see Section 9.1 of
3392 [RFC2616]). Responses to this method MUST NOT be cached.
3393
33949.10.1. Creating a Lock on an Existing Resource
3395
3396 A LOCK request to an existing resource will create a lock on the
3397 resource identified by the Request-URI, provided the resource is not
3398 already locked with a conflicting lock. The resource identified in
3399 the Request-URI becomes the root of the lock. LOCK method requests
3400 to create a new lock MUST have an XML request body. The server MUST
3401 preserve the information provided by the client in the 'owner'
3402 element in the LOCK request. The LOCK request MAY have a Timeout
3403 header.
3404
3405 When a new lock is created, the LOCK response:
3406
3407 o MUST contain a body with the value of the DAV:lockdiscovery
3408 property in a prop XML element. This MUST contain the full
3409 information about the lock just granted, while information about
3410 other (shared) locks is OPTIONAL.
3411
3412 o MUST include the Lock-Token response header with the token
3413 associated with the new lock.
3414
3415
3416
3417
3418Dusseault Standards Track [Page 61]
3419
3420RFC 4918 WebDAV June 2007
3421
3422
34239.10.2. Refreshing Locks
3424
3425 A lock is refreshed by sending a LOCK request to the URL of a
3426 resource within the scope of the lock. This request MUST NOT have a
3427 body and it MUST specify which lock to refresh by using the 'If'
3428 header with a single lock token (only one lock may be refreshed at a
3429 time). The request MAY contain a Timeout header, which a server MAY
3430 accept to change the duration remaining on the lock to the new value.
3431 A server MUST ignore the Depth header on a LOCK refresh.
3432
3433 If the resource has other (shared) locks, those locks are unaffected
3434 by a lock refresh. Additionally, those locks do not prevent the
3435 named lock from being refreshed.
3436
3437 The Lock-Token header is not returned in the response for a
3438 successful refresh LOCK request, but the LOCK response body MUST
3439 contain the new value for the DAV:lockdiscovery property.
3440
34419.10.3. Depth and Locking
3442
3443 The Depth header may be used with the LOCK method. Values other than
3444 0 or infinity MUST NOT be used with the Depth header on a LOCK
3445 method. All resources that support the LOCK method MUST support the
3446 Depth header.
3447
3448 A Depth header of value 0 means to just lock the resource specified
3449 by the Request-URI.
3450
3451 If the Depth header is set to infinity, then the resource specified
3452 in the Request-URI along with all its members, all the way down the
3453 hierarchy, are to be locked. A successful result MUST return a
3454 single lock token. Similarly, if an UNLOCK is successfully executed
3455 on this token, all associated resources are unlocked. Hence, partial
3456 success is not an option for LOCK or UNLOCK. Either the entire
3457 hierarchy is locked or no resources are locked.
3458
3459 If the lock cannot be granted to all resources, the server MUST
3460 return a Multi-Status response with a 'response' element for at least
3461 one resource that prevented the lock from being granted, along with a
3462 suitable status code for that failure (e.g., 403 (Forbidden) or 423
3463 (Locked)). Additionally, if the resource causing the failure was not
3464 the resource requested, then the server SHOULD include a 'response'
3465 element for the Request-URI as well, with a 'status' element
3466 containing 424 Failed Dependency.
3467
3468 If no Depth header is submitted on a LOCK request, then the request
3469 MUST act as if a "Depth:infinity" had been submitted.
3470
3471
3472
3473
3474Dusseault Standards Track [Page 62]
3475
3476RFC 4918 WebDAV June 2007
3477
3478
34799.10.4. Locking Unmapped URLs
3480
3481 A successful LOCK method MUST result in the creation of an empty
3482 resource that is locked (and that is not a collection) when a
3483 resource did not previously exist at that URL. Later on, the lock
3484 may go away but the empty resource remains. Empty resources MUST
3485 then appear in PROPFIND responses including that URL in the response
3486 scope. A server MUST respond successfully to a GET request to an
3487 empty resource, either by using a 204 No Content response, or by
3488 using 200 OK with a Content-Length header indicating zero length
3489
34909.10.5. Lock Compatibility Table
3491
3492 The table below describes the behavior that occurs when a lock
3493 request is made on a resource.
3494
3495 +--------------------------+----------------+-------------------+
3496 | Current State | Shared Lock OK | Exclusive Lock OK |
3497 +--------------------------+----------------+-------------------+
3498 | None | True | True |
3499 | Shared Lock | True | False |
3500 | Exclusive Lock | False | False* |
3501 +--------------------------+----------------+-------------------+
3502
3503 Legend: True = lock may be granted. False = lock MUST NOT be
3504 granted. *=It is illegal for a principal to request the same lock
3505 twice.
3506
3507 The current lock state of a resource is given in the leftmost column,
3508 and lock requests are listed in the first row. The intersection of a
3509 row and column gives the result of a lock request. For example, if a
3510 shared lock is held on a resource, and an exclusive lock is
3511 requested, the table entry is "false", indicating that the lock must
3512 not be granted.
3513
35149.10.6. LOCK Responses
3515
3516 In addition to the general status codes possible, the following
3517 status codes have specific applicability to LOCK:
3518
3519 200 (OK) - The LOCK request succeeded and the value of the DAV:
3520 lockdiscovery property is included in the response body.
3521
3522 201 (Created) - The LOCK request was to an unmapped URL, the request
3523 succeeded and resulted in the creation of a new resource, and the
3524 value of the DAV:lockdiscovery property is included in the response
3525 body.
3526
3527
3528
3529
3530Dusseault Standards Track [Page 63]
3531
3532RFC 4918 WebDAV June 2007
3533
3534
3535 409 (Conflict) - A resource cannot be created at the destination
3536 until one or more intermediate collections have been created. The
3537 server MUST NOT create those intermediate collections automatically.
3538
3539 423 (Locked), potentially with 'no-conflicting-lock' precondition
3540 code - There is already a lock on the resource that is not compatible
3541 with the requested lock (see lock compatibility table above).
3542
3543 412 (Precondition Failed), with 'lock-token-matches-request-uri'
3544 precondition code - The LOCK request was made with an If header,
3545 indicating that the client wishes to refresh the given lock.
3546 However, the Request-URI did not fall within the scope of the lock
3547 identified by the token. The lock may have a scope that does not
3548 include the Request-URI, or the lock could have disappeared, or the
3549 token may be invalid.
3550
35519.10.7. Example - Simple Lock Request
3552
3553 >>Request
3554
3555 LOCK /workspace/webdav/proposal.doc HTTP/1.1
3556 Host: example.com
3557 Timeout: Infinite, Second-4100000000
3558 Content-Type: application/xml; charset="utf-8"
3559 Content-Length: xxxx
3560 Authorization: Digest username="ejw",
3561 realm="ejw@example.com", nonce="...",
3562 uri="/workspace/webdav/proposal.doc",
3563 response="...", opaque="..."
3564
3565 <?xml version="1.0" encoding="utf-8" ?>
3566 <D:lockinfo xmlns:D='DAV:'>
3567 <D:lockscope><D:exclusive/></D:lockscope>
3568 <D:locktype><D:write/></D:locktype>
3569 <D:owner>
3570 <D:href>http://example.org/~ejw/contact.html</D:href>
3571 </D:owner>
3572 </D:lockinfo>
3573
3574 >>Response
3575
3576 HTTP/1.1 200 OK
3577 Lock-Token: <urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4>
3578 Content-Type: application/xml; charset="utf-8"
3579 Content-Length: xxxx
3580
3581 <?xml version="1.0" encoding="utf-8" ?>
3582 <D:prop xmlns:D="DAV:">
3583
3584
3585
3586Dusseault Standards Track [Page 64]
3587
3588RFC 4918 WebDAV June 2007
3589
3590
3591 <D:lockdiscovery>
3592 <D:activelock>
3593 <D:locktype><D:write/></D:locktype>
3594 <D:lockscope><D:exclusive/></D:lockscope>
3595 <D:depth>infinity</D:depth>
3596 <D:owner>
3597 <D:href>http://example.org/~ejw/contact.html</D:href>
3598 </D:owner>
3599 <D:timeout>Second-604800</D:timeout>
3600 <D:locktoken>
3601 <D:href
3602 >urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4</D:href>
3603 </D:locktoken>
3604 <D:lockroot>
3605 <D:href
3606 >http://example.com/workspace/webdav/proposal.doc</D:href>
3607 </D:lockroot>
3608 </D:activelock>
3609 </D:lockdiscovery>
3610 </D:prop>
3611
3612
3613 This example shows the successful creation of an exclusive write lock
3614 on resource http://example.com/workspace/webdav/proposal.doc. The
3615 resource http://example.org/~ejw/contact.html contains contact
3616 information for the creator of the lock. The server has an activity-
3617 based timeout policy in place on this resource, which causes the lock
3618 to automatically be removed after 1 week (604800 seconds). Note that
3619 the nonce, response, and opaque fields have not been calculated in
3620 the Authorization request header.
3621
36229.10.8. Example - Refreshing a Write Lock
3623
3624 >>Request
3625
3626 LOCK /workspace/webdav/proposal.doc HTTP/1.1
3627 Host: example.com
3628 Timeout: Infinite, Second-4100000000
3629 If: (<urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4>)
3630 Authorization: Digest username="ejw",
3631 realm="ejw@example.com", nonce="...",
3632 uri="/workspace/webdav/proposal.doc",
3633 response="...", opaque="..."
3634
3635
3636
3637
3638
3639
3640
3641
3642Dusseault Standards Track [Page 65]
3643
3644RFC 4918 WebDAV June 2007
3645
3646
3647 >>Response
3648
3649 HTTP/1.1 200 OK
3650 Content-Type: application/xml; charset="utf-8"
3651 Content-Length: xxxx
3652
3653 <?xml version="1.0" encoding="utf-8" ?>
3654 <D:prop xmlns:D="DAV:">
3655 <D:lockdiscovery>
3656 <D:activelock>
3657 <D:locktype><D:write/></D:locktype>
3658 <D:lockscope><D:exclusive/></D:lockscope>
3659 <D:depth>infinity</D:depth>
3660 <D:owner>
3661 <D:href>http://example.org/~ejw/contact.html</D:href>
3662 </D:owner>
3663 <D:timeout>Second-604800</D:timeout>
3664 <D:locktoken>
3665 <D:href
3666 >urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4</D:href>
3667 </D:locktoken>
3668 <D:lockroot>
3669 <D:href
3670 >http://example.com/workspace/webdav/proposal.doc</D:href>
3671 </D:lockroot>
3672 </D:activelock>
3673 </D:lockdiscovery>
3674 </D:prop>
3675
3676
3677 This request would refresh the lock, attempting to reset the timeout
3678 to the new value specified in the timeout header. Notice that the
3679 client asked for an infinite time out but the server choose to ignore
3680 the request. In this example, the nonce, response, and opaque fields
3681 have not been calculated in the Authorization request header.
3682
36839.10.9. Example - Multi-Resource Lock Request
3684
3685 >>Request
3686
3687 LOCK /webdav/ HTTP/1.1
3688 Host: example.com
3689 Timeout: Infinite, Second-4100000000
3690 Depth: infinity
3691 Content-Type: application/xml; charset="utf-8"
3692 Content-Length: xxxx
3693 Authorization: Digest username="ejw",
3694 realm="ejw@example.com", nonce="...",
3695
3696
3697
3698Dusseault Standards Track [Page 66]
3699
3700RFC 4918 WebDAV June 2007
3701
3702
3703 uri="/workspace/webdav/proposal.doc",
3704 response="...", opaque="..."
3705
3706 <?xml version="1.0" encoding="utf-8" ?>
3707 <D:lockinfo xmlns:D="DAV:">
3708 <D:locktype><D:write/></D:locktype>
3709 <D:lockscope><D:exclusive/></D:lockscope>
3710 <D:owner>
3711 <D:href>http://example.org/~ejw/contact.html</D:href>
3712 </D:owner>
3713 </D:lockinfo>
3714
3715 >>Response
3716
3717 HTTP/1.1 207 Multi-Status
3718 Content-Type: application/xml; charset="utf-8"
3719 Content-Length: xxxx
3720
3721 <?xml version="1.0" encoding="utf-8" ?>
3722 <D:multistatus xmlns:D="DAV:">
3723 <D:response>
3724 <D:href>http://example.com/webdav/secret</D:href>
3725 <D:status>HTTP/1.1 403 Forbidden</D:status>
3726 </D:response>
3727 <D:response>
3728 <D:href>http://example.com/webdav/</D:href>
3729 <D:status>HTTP/1.1 424 Failed Dependency</D:status>
3730 </D:response>
3731 </D:multistatus>
3732
3733
3734 This example shows a request for an exclusive write lock on a
3735 collection and all its children. In this request, the client has
3736 specified that it desires an infinite-length lock, if available,
3737 otherwise a timeout of 4.1 billion seconds, if available. The
3738 request entity body contains the contact information for the
3739 principal taking out the lock -- in this case, a Web page URL.
3740
3741 The error is a 403 (Forbidden) response on the resource
3742 http://example.com/webdav/secret. Because this resource could not be
3743 locked, none of the resources were locked. Note also that the a
3744 'response' element for the Request-URI itself has been included as
3745 required.
3746
3747 In this example, the nonce, response, and opaque fields have not been
3748 calculated in the Authorization request header.
3749
3750
3751
3752
3753
3754Dusseault Standards Track [Page 67]
3755
3756RFC 4918 WebDAV June 2007
3757
3758
37599.11. UNLOCK Method
3760
3761 The UNLOCK method removes the lock identified by the lock token in
3762 the Lock-Token request header. The Request-URI MUST identify a
3763 resource within the scope of the lock.
3764
3765 Note that use of the Lock-Token header to provide the lock token is
3766 not consistent with other state-changing methods, which all require
3767 an If header with the lock token. Thus, the If header is not needed
3768 to provide the lock token. Naturally, when the If header is present,
3769 it has its normal meaning as a conditional header.
3770
3771 For a successful response to this method, the server MUST delete the
3772 lock entirely.
3773
3774 If all resources that have been locked under the submitted lock token
3775 cannot be unlocked, then the UNLOCK request MUST fail.
3776
3777 A successful response to an UNLOCK method does not mean that the
3778 resource is necessarily unlocked. It means that the specific lock
3779 corresponding to the specified token no longer exists.
3780
3781 Any DAV-compliant resource that supports the LOCK method MUST support
3782 the UNLOCK method.
3783
3784 This method is idempotent, but not safe (see Section 9.1 of
3785 [RFC2616]). Responses to this method MUST NOT be cached.
3786
37879.11.1. Status Codes
3788
3789 In addition to the general status codes possible, the following
3790 status codes have specific applicability to UNLOCK:
3791
3792 204 (No Content) - Normal success response (rather than 200 OK, since
3793 200 OK would imply a response body, and an UNLOCK success response
3794 does not normally contain a body).
3795
3796 400 (Bad Request) - No lock token was provided.
3797
3798 403 (Forbidden) - The currently authenticated principal does not have
3799 permission to remove the lock.
3800
3801 409 (Conflict), with 'lock-token-matches-request-uri' precondition -
3802 The resource was not locked, or the request was made to a Request-URI
3803 that was not within the scope of the lock.
3804
3805
3806
3807
3808
3809
3810Dusseault Standards Track [Page 68]
3811
3812RFC 4918 WebDAV June 2007
3813
3814
38159.11.2. Example - UNLOCK
3816
3817 >>Request
3818
3819 UNLOCK /workspace/webdav/info.doc HTTP/1.1
3820 Host: example.com
3821 Lock-Token: <urn:uuid:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7>
3822 Authorization: Digest username="ejw"
3823 realm="ejw@example.com", nonce="...",
3824 uri="/workspace/webdav/proposal.doc",
3825 response="...", opaque="..."
3826
3827 >>Response
3828
3829 HTTP/1.1 204 No Content
3830
3831 In this example, the lock identified by the lock token
3832 "urn:uuid:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7" is successfully
3833 removed from the resource
3834 http://example.com/workspace/webdav/info.doc. If this lock included
3835 more than just one resource, the lock is removed from all resources
3836 included in the lock.
3837
3838 In this example, the nonce, response, and opaque fields have not been
3839 calculated in the Authorization request header.
3840
384110. HTTP Headers for Distributed Authoring
3842
3843 All DAV headers follow the same basic formatting rules as HTTP
3844 headers. This includes rules like line continuation and how to
3845 combine (or separate) multiple instances of the same header using
3846 commas.
3847
3848 WebDAV adds two new conditional headers to the set defined in HTTP:
3849 the If and Overwrite headers.
3850
385110.1. DAV Header
3852
3853 DAV = "DAV" ":" #( compliance-class )
3854 compliance-class = ( "1" | "2" | "3" | extend )
3855 extend = Coded-URL | token
3856 ; token is defined in RFC 2616, Section 2.2
3857 Coded-URL = "<" absolute-URI ">"
3858 ; No linear whitespace (LWS) allowed in Coded-URL
3859 ; absolute-URI defined in RFC 3986, Section 4.3
3860
3861
3862
3863
3864
3865
3866Dusseault Standards Track [Page 69]
3867
3868RFC 4918 WebDAV June 2007
3869
3870
3871 This general-header appearing in the response indicates that the
3872 resource supports the DAV schema and protocol as specified. All DAV-
3873 compliant resources MUST return the DAV header with compliance-class
3874 "1" on all OPTIONS responses. In cases where WebDAV is only
3875 supported in part of the server namespace, an OPTIONS request to non-
3876 WebDAV resources (including "/") SHOULD NOT advertise WebDAV support.
3877
3878 The value is a comma-separated list of all compliance class
3879 identifiers that the resource supports. Class identifiers may be
3880 Coded-URLs or tokens (as defined by [RFC2616]). Identifiers can
3881 appear in any order. Identifiers that are standardized through the
3882 IETF RFC process are tokens, but other identifiers SHOULD be Coded-
3883 URLs to encourage uniqueness.
3884
3885 A resource must show class 1 compliance if it shows class 2 or 3
3886 compliance. In general, support for one compliance class does not
3887 entail support for any other, and in particular, support for
3888 compliance class 3 does not require support for compliance class 2.
3889 Please refer to Section 18 for more details on compliance classes
3890 defined in this specification.
3891
3892 Note that many WebDAV servers do not advertise WebDAV support in
3893 response to "OPTIONS *".
3894
3895 As a request header, this header allows the client to advertise
3896 compliance with named features when the server needs that
3897 information. Clients SHOULD NOT send this header unless a standards
3898 track specification requires it. Any extension that makes use of
3899 this as a request header will need to carefully consider caching
3900 implications.
3901
390210.2. Depth Header
3903
3904 Depth = "Depth" ":" ("0" | "1" | "infinity")
3905
3906 The Depth request header is used with methods executed on resources
3907 that could potentially have internal members to indicate whether the
3908 method is to be applied only to the resource ("Depth: 0"), to the
3909 resource and its internal members only ("Depth: 1"), or the resource
3910 and all its members ("Depth: infinity").
3911
3912 The Depth header is only supported if a method's definition
3913 explicitly provides for such support.
3914
3915 The following rules are the default behavior for any method that
3916 supports the Depth header. A method may override these defaults by
3917 defining different behavior in its definition.
3918
3919
3920
3921
3922Dusseault Standards Track [Page 70]
3923
3924RFC 4918 WebDAV June 2007
3925
3926
3927 Methods that support the Depth header may choose not to support all
3928 of the header's values and may define, on a case-by-case basis, the
3929 behavior of the method if a Depth header is not present. For
3930 example, the MOVE method only supports "Depth: infinity", and if a
3931 Depth header is not present, it will act as if a "Depth: infinity"
3932 header had been applied.
3933
3934 Clients MUST NOT rely upon methods executing on members of their
3935 hierarchies in any particular order or on the execution being atomic
3936 unless the particular method explicitly provides such guarantees.
3937
3938 Upon execution, a method with a Depth header will perform as much of
3939 its assigned task as possible and then return a response specifying
3940 what it was able to accomplish and what it failed to do.
3941
3942 So, for example, an attempt to COPY a hierarchy may result in some of
3943 the members being copied and some not.
3944
3945 By default, the Depth header does not interact with other headers.
3946 That is, each header on a request with a Depth header MUST be applied
3947 only to the Request-URI if it applies to any resource, unless
3948 specific Depth behavior is defined for that header.
3949
3950 If a source or destination resource within the scope of the Depth
3951 header is locked in such a way as to prevent the successful execution
3952 of the method, then the lock token for that resource MUST be
3953 submitted with the request in the If request header.
3954
3955 The Depth header only specifies the behavior of the method with
3956 regards to internal members. If a resource does not have internal
3957 members, then the Depth header MUST be ignored.
3958
395910.3. Destination Header
3960
3961 The Destination request header specifies the URI that identifies a
3962 destination resource for methods such as COPY and MOVE, which take
3963 two URIs as parameters.
3964
3965 Destination = "Destination" ":" Simple-ref
3966
3967
3968 If the Destination value is an absolute-URI (Section 4.3 of
3969 [RFC3986]), it may name a different server (or different port or
3970 scheme). If the source server cannot attempt a copy to the remote
3971 server, it MUST fail the request. Note that copying and moving
3972 resources to remote servers is not fully defined in this
3973 specification (e.g., specific error conditions).
3974
3975
3976
3977
3978Dusseault Standards Track [Page 71]
3979
3980RFC 4918 WebDAV June 2007
3981
3982
3983 If the Destination value is too long or otherwise unacceptable, the
3984 server SHOULD return 400 (Bad Request), ideally with helpful
3985 information in an error body.
3986
398710.4. If Header
3988
3989 The If request header is intended to have similar functionality to
3990 the If-Match header defined in Section 14.24 of [RFC2616]. However,
3991 the If header handles any state token as well as ETags. A typical
3992 example of a state token is a lock token, and lock tokens are the
3993 only state tokens defined in this specification.
3994
399510.4.1. Purpose
3996
3997 The If header has two distinct purposes:
3998
3999 o The first purpose is to make a request conditional by supplying a
4000 series of state lists with conditions that match tokens and ETags
4001 to a specific resource. If this header is evaluated and all state
4002 lists fail, then the request MUST fail with a 412 (Precondition
4003 Failed) status. On the other hand, the request can succeed only
4004 if one of the described state lists succeeds. The success
4005 criteria for state lists and matching functions are defined in
4006 Sections 10.4.3 and 10.4.4.
4007
4008 o Additionally, the mere fact that a state token appears in an If
4009 header means that it has been "submitted" with the request. In
4010 general, this is used to indicate that the client has knowledge of
4011 that state token. The semantics for submitting a state token
4012 depend on its type (for lock tokens, please refer to Section 6).
4013
4014 Note that these two purposes need to be treated distinctly: a state
4015 token counts as being submitted independently of whether the server
4016 actually has evaluated the state list it appears in, and also
4017 independently of whether or not the condition it expressed was found
4018 to be true.
4019
402010.4.2. Syntax
4021
4022 If = "If" ":" ( 1*No-tag-list | 1*Tagged-list )
4023
4024 No-tag-list = List
4025 Tagged-list = Resource-Tag 1*List
4026
4027 List = "(" 1*Condition ")"
4028 Condition = ["Not"] (State-token | "[" entity-tag "]")
4029 ; entity-tag: see Section 3.11 of [RFC2616]
4030 ; No LWS allowed between "[", entity-tag and "]"
4031
4032
4033
4034Dusseault Standards Track [Page 72]
4035
4036RFC 4918 WebDAV June 2007
4037
4038
4039 State-token = Coded-URL
4040
4041 Resource-Tag = "<" Simple-ref ">"
4042 ; Simple-ref: see Section 8.3
4043 ; No LWS allowed in Resource-Tag
4044
4045 The syntax distinguishes between untagged lists ("No-tag-list") and
4046 tagged lists ("Tagged-list"). Untagged lists apply to the resource
4047 identified by the Request-URI, while tagged lists apply to the
4048 resource identified by the preceding Resource-Tag.
4049
4050 A Resource-Tag applies to all subsequent Lists, up to the next
4051 Resource-Tag.
4052
4053 Note that the two list types cannot be mixed within an If header.
4054 This is not a functional restriction because the No-tag-list syntax
4055 is just a shorthand notation for a Tagged-list production with a
4056 Resource-Tag referring to the Request-URI.
4057
4058 Each List consists of one or more Conditions. Each Condition is
4059 defined in terms of an entity-tag or state-token, potentially negated
4060 by the prefix "Not".
4061
4062 Note that the If header syntax does not allow multiple instances of
4063 If headers in a single request. However, the HTTP header syntax
4064 allows extending single header values across multiple lines, by
4065 inserting a line break followed by whitespace (see [RFC2616], Section
4066 4.2).
4067
406810.4.3. List Evaluation
4069
4070 A Condition that consists of a single entity-tag or state-token
4071 evaluates to true if the resource matches the described state (where
4072 the individual matching functions are defined below in
4073 Section 10.4.4). Prefixing it with "Not" reverses the result of the
4074 evaluation (thus, the "Not" applies only to the subsequent entity-tag
4075 or state-token).
4076
4077 Each List production describes a series of conditions. The whole
4078 list evaluates to true if and only if each condition evaluates to
4079 true (that is, the list represents a logical conjunction of
4080 Conditions).
4081
4082 Each No-tag-list and Tagged-list production may contain one or more
4083 Lists. They evaluate to true if and only if any of the contained
4084 lists evaluates to true (that is, if there's more than one List, that
4085 List sequence represents a logical disjunction of the Lists).
4086
4087
4088
4089
4090Dusseault Standards Track [Page 73]
4091
4092RFC 4918 WebDAV June 2007
4093
4094
4095 Finally, the whole If header evaluates to true if and only if at
4096 least one of the No-tag-list or Tagged-list productions evaluates to
4097 true. If the header evaluates to false, the server MUST reject the
4098 request with a 412 (Precondition Failed) status. Otherwise,
4099 execution of the request can proceed as if the header wasn't present.
4100
410110.4.4. Matching State Tokens and ETags
4102
4103 When performing If header processing, the definition of a matching
4104 state token or entity tag is as follows:
4105
4106 Identifying a resource: The resource is identified by the URI along
4107 with the token, in tagged list production, or by the Request-URI in
4108 untagged list production.
4109
4110 Matching entity tag: Where the entity tag matches an entity tag
4111 associated with the identified resource. Servers MUST use either the
4112 weak or the strong comparison function defined in Section 13.3.3 of
4113 [RFC2616].
4114
4115 Matching state token: Where there is an exact match between the state
4116 token in the If header and any state token on the identified
4117 resource. A lock state token is considered to match if the resource
4118 is anywhere in the scope of the lock.
4119
4120 Handling unmapped URLs: For both ETags and state tokens, treat as if
4121 the URL identified a resource that exists but does not have the
4122 specified state.
4123
412410.4.5. If Header and Non-DAV-Aware Proxies
4125
4126 Non-DAV-aware proxies will not honor the If header, since they will
4127 not understand the If header, and HTTP requires non-understood
4128 headers to be ignored. When communicating with HTTP/1.1 proxies, the
4129 client MUST use the "Cache-Control: no-cache" request header so as to
4130 prevent the proxy from improperly trying to service the request from
4131 its cache. When dealing with HTTP/1.0 proxies, the "Pragma: no-
4132 cache" request header MUST be used for the same reason.
4133
4134 Because in general clients may not be able to reliably detect non-
4135 DAV-aware intermediates, they are advised to always prevent caching
4136 using the request directives mentioned above.
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146Dusseault Standards Track [Page 74]
4147
4148RFC 4918 WebDAV June 2007
4149
4150
415110.4.6. Example - No-tag Production
4152
4153 If: (<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>
4154 ["I am an ETag"])
4155 (["I am another ETag"])
4156
4157 The previous header would require that the resource identified in the
4158 Request-URI be locked with the specified lock token and be in the
4159 state identified by the "I am an ETag" ETag or in the state
4160 identified by the second ETag "I am another ETag".
4161
4162 To put the matter more plainly one can think of the previous If
4163 header as expressing the condition below:
4164
4165 (
4166 is-locked-with(urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2) AND
4167 matches-etag("I am an ETag")
4168 )
4169 OR
4170 (
4171 matches-etag("I am another ETag")
4172 )
4173
417410.4.7. Example - Using "Not" with No-tag Production
4175
4176 If: (Not <urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>
4177 <urn:uuid:58f202ac-22cf-11d1-b12d-002035b29092>)
4178
4179 This If header requires that the resource must not be locked with a
4180 lock having the lock token
4181 urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2 and must be locked by a
4182 lock with the lock token
4183 urn:uuid:58f202ac-22cf-11d1-b12d-002035b29092.
4184
418510.4.8. Example - Causing a Condition to Always Evaluate to True
4186
4187 There may be cases where a client wishes to submit state tokens, but
4188 doesn't want the request to fail just because the state token isn't
4189 current anymore. One simple way to do this is to include a Condition
4190 that is known to always evaluate to true, such as in:
4191
4192 If: (<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>)
4193 (Not <DAV:no-lock>)
4194
4195 "DAV:no-lock" is known to never represent a current lock token. Lock
4196 tokens are assigned by the server, following the uniqueness
4197 requirements described in Section 6.5, therefore cannot use the
4198 "DAV:" scheme. Thus, by applying "Not" to a state token that is
4199
4200
4201
4202Dusseault Standards Track [Page 75]
4203
4204RFC 4918 WebDAV June 2007
4205
4206
4207 known not to be current, the Condition always evaluates to true.
4208 Consequently, the whole If header will always evaluate to true, and
4209 the lock token urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2 will be
4210 submitted in any case.
4211
421210.4.9. Example - Tagged List If Header in COPY
4213
4214 >>Request
4215
4216 COPY /resource1 HTTP/1.1
4217 Host: www.example.com
4218 Destination: /resource2
4219 If: </resource1>
4220 (<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>
4221 [W/"A weak ETag"]) (["strong ETag"])
4222
4223 In this example, http://www.example.com/resource1 is being copied to
4224 http://www.example.com/resource2. When the method is first applied
4225 to http://www.example.com/resource1, resource1 must be in the state
4226 specified by "(<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2> [W/"A
4227 weak ETag"]) (["strong ETag"])". That is, either it must be locked
4228 with a lock token of "urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2"
4229 and have a weak entity tag W/"A weak ETag" or it must have a strong
4230 entity tag "strong ETag".
4231
423210.4.10. Example - Matching Lock Tokens with Collection Locks
4233
4234 DELETE /specs/rfc2518.txt HTTP/1.1
4235 Host: www.example.com
4236 If: <http://www.example.com/specs/>
4237 (<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>)
4238
4239 For this example, the lock token must be compared to the identified
4240 resource, which is the 'specs' collection identified by the URL in
4241 the tagged list production. If the 'specs' collection is not locked
4242 by a lock with the specified lock token, the request MUST fail.
4243 Otherwise, this request could succeed, because the If header
4244 evaluates to true, and because the lock token for the lock affecting
4245 the affected resource has been submitted.
4246
424710.4.11. Example - Matching ETags on Unmapped URLs
4248
4249 Consider a collection "/specs" that does not contain the member
4250 "/specs/rfc2518.doc". In this case, the If header
4251
4252 If: </specs/rfc2518.doc> (["4217"])
4253
4254
4255
4256
4257
4258Dusseault Standards Track [Page 76]
4259
4260RFC 4918 WebDAV June 2007
4261
4262
4263 will evaluate to false (the URI isn't mapped, thus the resource
4264 identified by the URI doesn't have an entity matching the ETag
4265 "4217").
4266
4267 On the other hand, an If header of
4268
4269 If: </specs/rfc2518.doc> (Not ["4217"])
4270
4271 will consequently evaluate to true.
4272
4273 Note that, as defined above in Section 10.4.4, the same
4274 considerations apply to matching state tokens.
4275
427610.5. Lock-Token Header
4277
4278 Lock-Token = "Lock-Token" ":" Coded-URL
4279
4280 The Lock-Token request header is used with the UNLOCK method to
4281 identify the lock to be removed. The lock token in the Lock-Token
4282 request header MUST identify a lock that contains the resource
4283 identified by Request-URI as a member.
4284
4285 The Lock-Token response header is used with the LOCK method to
4286 indicate the lock token created as a result of a successful LOCK
4287 request to create a new lock.
4288
428910.6. Overwrite Header
4290
4291 Overwrite = "Overwrite" ":" ("T" | "F")
4292
4293 The Overwrite request header specifies whether the server should
4294 overwrite a resource mapped to the destination URL during a COPY or
4295 MOVE. A value of "F" states that the server must not perform the
4296 COPY or MOVE operation if the destination URL does map to a resource.
4297 If the overwrite header is not included in a COPY or MOVE request,
4298 then the resource MUST treat the request as if it has an overwrite
4299 header of value "T". While the Overwrite header appears to duplicate
4300 the functionality of using an "If-Match: *" header (see [RFC2616]),
4301 If-Match applies only to the Request-URI, and not to the Destination
4302 of a COPY or MOVE.
4303
4304 If a COPY or MOVE is not performed due to the value of the Overwrite
4305 header, the method MUST fail with a 412 (Precondition Failed) status
4306 code. The server MUST do authorization checks before checking this
4307 or any conditional header.
4308
4309 All DAV-compliant resources MUST support the Overwrite header.
4310
4311
4312
4313
4314Dusseault Standards Track [Page 77]
4315
4316RFC 4918 WebDAV June 2007
4317
4318
431910.7. Timeout Request Header
4320
4321 TimeOut = "Timeout" ":" 1#TimeType
4322 TimeType = ("Second-" DAVTimeOutVal | "Infinite")
4323 ; No LWS allowed within TimeType
4324 DAVTimeOutVal = 1*DIGIT
4325
4326 Clients MAY include Timeout request headers in their LOCK requests.
4327 However, the server is not required to honor or even consider these
4328 requests. Clients MUST NOT submit a Timeout request header with any
4329 method other than a LOCK method.
4330
4331 The "Second" TimeType specifies the number of seconds that will
4332 elapse between granting of the lock at the server, and the automatic
4333 removal of the lock. The timeout value for TimeType "Second" MUST
4334 NOT be greater than 2^32-1.
4335
4336 See Section 6.6 for a description of lock timeout behavior.
4337
433811. Status Code Extensions to HTTP/1.1
4339
4340 The following status codes are added to those defined in HTTP/1.1
4341 [RFC2616].
4342
434311.1. 207 Multi-Status
4344
4345 The 207 (Multi-Status) status code provides status for multiple
4346 independent operations (see Section 13 for more information).
4347
434811.2. 422 Unprocessable Entity
4349
4350 The 422 (Unprocessable Entity) status code means the server
4351 understands the content type of the request entity (hence a
4352 415(Unsupported Media Type) status code is inappropriate), and the
4353 syntax of the request entity is correct (thus a 400 (Bad Request)
4354 status code is inappropriate) but was unable to process the contained
4355 instructions. For example, this error condition may occur if an XML
4356 request body contains well-formed (i.e., syntactically correct), but
4357 semantically erroneous, XML instructions.
4358
435911.3. 423 Locked
4360
4361 The 423 (Locked) status code means the source or destination resource
4362 of a method is locked. This response SHOULD contain an appropriate
4363 precondition or postcondition code, such as 'lock-token-submitted' or
4364 'no-conflicting-lock'.
4365
4366
4367
4368
4369
4370Dusseault Standards Track [Page 78]
4371
4372RFC 4918 WebDAV June 2007
4373
4374
437511.4. 424 Failed Dependency
4376
4377 The 424 (Failed Dependency) status code means that the method could
4378 not be performed on the resource because the requested action
4379 depended on another action and that action failed. For example, if a
4380 command in a PROPPATCH method fails, then, at minimum, the rest of
4381 the commands will also fail with 424 (Failed Dependency).
4382
438311.5. 507 Insufficient Storage
4384
4385 The 507 (Insufficient Storage) status code means the method could not
4386 be performed on the resource because the server is unable to store
4387 the representation needed to successfully complete the request. This
4388 condition is considered to be temporary. If the request that
4389 received this status code was the result of a user action, the
4390 request MUST NOT be repeated until it is requested by a separate user
4391 action.
4392
439312. Use of HTTP Status Codes
4394
4395 These HTTP codes are not redefined, but their use is somewhat
4396 extended by WebDAV methods and requirements. In general, many HTTP
4397 status codes can be used in response to any request, not just in
4398 cases described in this document. Note also that WebDAV servers are
4399 known to use 300-level redirect responses (and early interoperability
4400 tests found clients unprepared to see those responses). A 300-level
4401 response MUST NOT be used when the server has created a new resource
4402 in response to the request.
4403
440412.1. 412 Precondition Failed
4405
4406 Any request can contain a conditional header defined in HTTP (If-
4407 Match, If-Modified-Since, etc.) or the "If" or "Overwrite"
4408 conditional headers defined in this specification. If the server
4409 evaluates a conditional header, and if that condition fails to hold,
4410 then this error code MUST be returned. On the other hand, if the
4411 client did not include a conditional header in the request, then the
4412 server MUST NOT use this status code.
4413
441412.2. 414 Request-URI Too Long
4415
4416 This status code is used in HTTP 1.1 only for Request-URIs, not URIs
4417 in other locations.
4418
4419
4420
4421
4422
4423
4424
4425
4426Dusseault Standards Track [Page 79]
4427
4428RFC 4918 WebDAV June 2007
4429
4430
443113. Multi-Status Response
4432
4433 A Multi-Status response conveys information about multiple resources
4434 in situations where multiple status codes might be appropriate. The
4435 default Multi-Status response body is a text/xml or application/xml
4436 HTTP entity with a 'multistatus' root element. Further elements
4437 contain 200, 300, 400, and 500 series status codes generated during
4438 the method invocation. 100 series status codes SHOULD NOT be recorded
4439 in a 'response' XML element.
4440
4441 Although '207' is used as the overall response status code, the
4442 recipient needs to consult the contents of the multistatus response
4443 body for further information about the success or failure of the
4444 method execution. The response MAY be used in success, partial
4445 success and also in failure situations.
4446
4447 The 'multistatus' root element holds zero or more 'response' elements
4448 in any order, each with information about an individual resource.
4449 Each 'response' element MUST have an 'href' element to identify the
4450 resource.
4451
4452 A Multi-Status response uses one out of two distinct formats for
4453 representing the status:
4454
4455 1. A 'status' element as child of the 'response' element indicates
4456 the status of the message execution for the identified resource
4457 as a whole (for instance, see Section 9.6.2). Some method
4458 definitions provide information about specific status codes
4459 clients should be prepared to see in a response. However,
4460 clients MUST be able to handle other status codes, using the
4461 generic rules defined in Section 10 of [RFC2616].
4462
4463 2. For PROPFIND and PROPPATCH, the format has been extended using
4464 the 'propstat' element instead of 'status', providing information
4465 about individual properties of a resource. This format is
4466 specific to PROPFIND and PROPPATCH, and is described in detail in
4467 Sections 9.1 and 9.2.
4468
446913.1. Response Headers
4470
4471 HTTP defines the Location header to indicate a preferred URL for the
4472 resource that was addressed in the Request-URI (e.g., in response to
4473 successful PUT requests or in redirect responses). However, use of
4474 this header creates ambiguity when there are URLs in the body of the
4475 response, as with Multi-Status. Thus, use of the Location header
4476 with the Multi-Status response is intentionally undefined.
4477
4478
4479
4480
4481
4482Dusseault Standards Track [Page 80]
4483
4484RFC 4918 WebDAV June 2007
4485
4486
448713.2. Handling Redirected Child Resources
4488
4489 Redirect responses (300-303, 305, and 307) defined in HTTP 1.1
4490 normally take a Location header to indicate the new URI for the
4491 single resource redirected from the Request-URI. Multi-Status
4492 responses contain many resource addresses, but the original
4493 definition in [RFC2518] did not have any place for the server to
4494 provide the new URI for redirected resources. This specification
4495 does define a 'location' element for this information (see
4496 Section 14.9). Servers MUST use this new element with redirect
4497 responses in Multi-Status.
4498
4499 Clients encountering redirected resources in Multi-Status MUST NOT
4500 rely on the 'location' element being present with a new URI. If the
4501 element is not present, the client MAY reissue the request to the
4502 individual redirected resource, because the response to that request
4503 can be redirected with a Location header containing the new URI.
4504
450513.3. Internal Status Codes
4506
4507 Sections 9.2.1, 9.1.2, 9.6.1, 9.8.3, and 9.9.2 define various status
4508 codes used in Multi-Status responses. This specification does not
4509 define the meaning of other status codes that could appear in these
4510 responses.
4511
451214. XML Element Definitions
4513
4514 In this section, the final line of each section gives the element
4515 type declaration using the format defined in [REC-XML]. The "Value"
4516 field, where present, specifies further restrictions on the allowable
4517 contents of the XML element using BNF (i.e., to further restrict the
4518 values of a PCDATA element). Note that all of the elements defined
4519 here may be extended according to the rules defined in Section 17.
4520 All elements defined here are in the "DAV:" namespace.
4521
452214.1. activelock XML Element
4523
4524 Name: activelock
4525
4526 Purpose: Describes a lock on a resource.
4527
4528
4529 <!ELEMENT activelock (lockscope, locktype, depth, owner?, timeout?,
4530 locktoken?, lockroot)>
4531
4532
4533
4534
4535
4536
4537
4538Dusseault Standards Track [Page 81]
4539
4540RFC 4918 WebDAV June 2007
4541
4542
454314.2. allprop XML Element
4544
4545 Name: allprop
4546
4547 Purpose: Specifies that all names and values of dead properties and
4548 the live properties defined by this document existing on the
4549 resource are to be returned.
4550
4551 <!ELEMENT allprop EMPTY >
4552
455314.3. collection XML Element
4554
4555 Name: collection
4556
4557 Purpose: Identifies the associated resource as a collection. The
4558 DAV:resourcetype property of a collection resource MUST contain
4559 this element. It is normally empty but extensions may add sub-
4560 elements.
4561
4562 <!ELEMENT collection EMPTY >
4563
456414.4. depth XML Element
4565
4566 Name: depth
4567
4568 Purpose: Used for representing depth values in XML content (e.g.,
4569 in lock information).
4570
4571 Value: "0" | "1" | "infinity"
4572
4573 <!ELEMENT depth (#PCDATA) >
4574
457514.5. error XML Element
4576
4577 Name: error
4578
4579 Purpose: Error responses, particularly 403 Forbidden and 409
4580 Conflict, sometimes need more information to indicate what went
4581 wrong. In these cases, servers MAY return an XML response body
4582 with a document element of 'error', containing child elements
4583 identifying particular condition codes.
4584
4585 Description: Contains at least one XML element, and MUST NOT
4586 contain text or mixed content. Any element that is a child of the
4587 'error' element is considered to be a precondition or
4588 postcondition code. Unrecognized elements MUST be ignored.
4589
4590 <!ELEMENT error ANY >
4591
4592
4593
4594Dusseault Standards Track [Page 82]
4595
4596RFC 4918 WebDAV June 2007
4597
4598
459914.6. exclusive XML Element
4600
4601 Name: exclusive
4602
4603 Purpose: Specifies an exclusive lock.
4604
4605
4606 <!ELEMENT exclusive EMPTY >
4607
4608
460914.7. href XML Element
4610
4611 Name: href
4612
4613 Purpose: MUST contain a URI or a relative reference.
4614
4615 Description: There may be limits on the value of 'href' depending
4616 on the context of its use. Refer to the specification text where
4617 'href' is used to see what limitations apply in each case.
4618
4619 Value: Simple-ref
4620
4621
4622 <!ELEMENT href (#PCDATA)>
4623
462414.8. include XML Element
4625
4626 Name: include
4627
4628 Purpose: Any child element represents the name of a property to be
4629 included in the PROPFIND response. All elements inside an
4630 'include' XML element MUST define properties related to the
4631 resource, although possible property names are in no way limited
4632 to those property names defined in this document or other
4633 standards. This element MUST NOT contain text or mixed content.
4634
4635 <!ELEMENT include ANY >
4636
463714.9. location XML Element
4638
4639 Name: location
4640
4641 Purpose: HTTP defines the "Location" header (see [RFC2616], Section
4642 14.30) for use with some status codes (such as 201 and the 300
4643 series codes). When these codes are used inside a 'multistatus'
4644 element, the 'location' element can be used to provide the
4645 accompanying Location header value.
4646
4647
4648
4649
4650Dusseault Standards Track [Page 83]
4651
4652RFC 4918 WebDAV June 2007
4653
4654
4655 Description: Contains a single href element with the same value
4656 that would be used in a Location header.
4657
4658
4659 <!ELEMENT location (href)>
4660
466114.10. lockentry XML Element
4662
4663 Name: lockentry
4664
4665 Purpose: Defines the types of locks that can be used with the
4666 resource.
4667
4668 <!ELEMENT lockentry (lockscope, locktype) >
4669
467014.11. lockinfo XML Element
4671
4672 Name: lockinfo
4673
4674 Purpose: The 'lockinfo' XML element is used with a LOCK method to
4675 specify the type of lock the client wishes to have created.
4676
4677
4678 <!ELEMENT lockinfo (lockscope, locktype, owner?) >
4679
468014.12. lockroot XML Element
4681
4682 Name: lockroot
4683
4684 Purpose: Contains the root URL of the lock, which is the URL
4685 through which the resource was addressed in the LOCK request.
4686
4687 Description: The href element contains the root of the lock. The
4688 server SHOULD include this in all DAV:lockdiscovery property
4689 values and the response to LOCK requests.
4690
4691 <!ELEMENT lockroot (href) >
4692
469314.13. lockscope XML Element
4694
4695 Name: lockscope
4696
4697 Purpose: Specifies whether a lock is an exclusive lock, or a shared
4698 lock.
4699
4700
4701 <!ELEMENT lockscope (exclusive | shared) >
4702
4703
4704
4705
4706Dusseault Standards Track [Page 84]
4707
4708RFC 4918 WebDAV June 2007
4709
4710
471114.14. locktoken XML Element
4712
4713 Name: locktoken
4714
4715 Purpose: The lock token associated with a lock.
4716
4717 Description: The href contains a single lock token URI, which
4718 refers to the lock.
4719
4720 <!ELEMENT locktoken (href) >
4721
472214.15. locktype XML Element
4723
4724 Name: locktype
4725
4726 Purpose: Specifies the access type of a lock. At present, this
4727 specification only defines one lock type, the write lock.
4728
4729
4730 <!ELEMENT locktype (write) >
4731
4732
473314.16. multistatus XML Element
4734
4735 Name: multistatus
4736
4737 Purpose: Contains multiple response messages.
4738
4739 Description: The 'responsedescription' element at the top level is
4740 used to provide a general message describing the overarching
4741 nature of the response. If this value is available, an
4742 application may use it instead of presenting the individual
4743 response descriptions contained within the responses.
4744
4745
4746 <!ELEMENT multistatus (response*, responsedescription?) >
4747
4748
474914.17. owner XML Element
4750
4751 Name: owner
4752
4753 Purpose: Holds client-supplied information about the creator of a
4754 lock.
4755
4756 Description: Allows a client to provide information sufficient for
4757 either directly contacting a principal (such as a telephone number
4758 or Email URI), or for discovering the principal (such as the URL
4759
4760
4761
4762Dusseault Standards Track [Page 85]
4763
4764RFC 4918 WebDAV June 2007
4765
4766
4767 of a homepage) who created a lock. The value provided MUST be
4768 treated as a dead property in terms of XML Information Item
4769 preservation. The server MUST NOT alter the value unless the
4770 owner value provided by the client is empty. For a certain amount
4771 of interoperability between different client implementations, if
4772 clients have URI-formatted contact information for the lock
4773 creator suitable for user display, then clients SHOULD put those
4774 URIs in 'href' child elements of the 'owner' element.
4775
4776 Extensibility: MAY be extended with child elements, mixed content,
4777 text content or attributes.
4778
4779 <!ELEMENT owner ANY >
4780
478114.18. prop XML Element
4782
4783 Name: prop
4784
4785 Purpose: Contains properties related to a resource.
4786
4787 Description: A generic container for properties defined on
4788 resources. All elements inside a 'prop' XML element MUST define
4789 properties related to the resource, although possible property
4790 names are in no way limited to those property names defined in
4791 this document or other standards. This element MUST NOT contain
4792 text or mixed content.
4793
4794 <!ELEMENT prop ANY >
4795
479614.19. propertyupdate XML Element
4797
4798 Name: propertyupdate
4799
4800 Purpose: Contains a request to alter the properties on a resource.
4801
4802 Description: This XML element is a container for the information
4803 required to modify the properties on the resource.
4804
4805 <!ELEMENT propertyupdate (remove | set)+ >
4806
480714.20. propfind XML Element
4808
4809 Name: propfind
4810
4811
4812
4813
4814
4815
4816
4817
4818Dusseault Standards Track [Page 86]
4819
4820RFC 4918 WebDAV June 2007
4821
4822
4823 Purpose: Specifies the properties to be returned from a PROPFIND
4824 method. Four special elements are specified for use with
4825 'propfind': 'prop', 'allprop', 'include', and 'propname'. If
4826 'prop' is used inside 'propfind', it MUST NOT contain property
4827 values.
4828
4829 <!ELEMENT propfind ( propname | (allprop, include?) | prop ) >
4830
483114.21. propname XML Element
4832
4833 Name: propname
4834
4835 Purpose: Specifies that only a list of property names on the
4836 resource is to be returned.
4837
4838 <!ELEMENT propname EMPTY >
4839
484014.22. propstat XML Element
4841
4842 Name: propstat
4843
4844 Purpose: Groups together a prop and status element that is
4845 associated with a particular 'href' element.
4846
4847 Description: The propstat XML element MUST contain one prop XML
4848 element and one status XML element. The contents of the prop XML
4849 element MUST only list the names of properties to which the result
4850 in the status element applies. The optional precondition/
4851 postcondition element and 'responsedescription' text also apply to
4852 the properties named in 'prop'.
4853
4854 <!ELEMENT propstat (prop, status, error?, responsedescription?) >
4855
485614.23. remove XML Element
4857
4858 Name: remove
4859
4860 Purpose: Lists the properties to be removed from a resource.
4861
4862 Description: Remove instructs that the properties specified in prop
4863 should be removed. Specifying the removal of a property that does
4864 not exist is not an error. All the XML elements in a 'prop' XML
4865 element inside of a 'remove' XML element MUST be empty, as only
4866 the names of properties to be removed are required.
4867
4868 <!ELEMENT remove (prop) >
4869
4870
4871
4872
4873
4874Dusseault Standards Track [Page 87]
4875
4876RFC 4918 WebDAV June 2007
4877
4878
487914.24. response XML Element
4880
4881 Name: response
4882
4883 Purpose: Holds a single response describing the effect of a method
4884 on resource and/or its properties.
4885
4886 Description: The 'href' element contains an HTTP URL pointing to a
4887 WebDAV resource when used in the 'response' container. A
4888 particular 'href' value MUST NOT appear more than once as the
4889 child of a 'response' XML element under a 'multistatus' XML
4890 element. This requirement is necessary in order to keep
4891 processing costs for a response to linear time. Essentially, this
4892 prevents having to search in order to group together all the
4893 responses by 'href'. There are, however, no requirements
4894 regarding ordering based on 'href' values. The optional
4895 precondition/postcondition element and 'responsedescription' text
4896 can provide additional information about this resource relative to
4897 the request or result.
4898
4899
4900 <!ELEMENT response (href, ((href*, status)|(propstat+)),
4901 error?, responsedescription? , location?) >
4902
490314.25. responsedescription XML Element
4904
4905 Name: responsedescription
4906
4907 Purpose: Contains information about a status response within a
4908 Multi-Status.
4909
4910 Description: Provides information suitable to be presented to a
4911 user.
4912
4913 <!ELEMENT responsedescription (#PCDATA) >
4914
491514.26. set XML Element
4916
4917 Name: set
4918
4919 Purpose: Lists the property values to be set for a resource.
4920
4921 Description: The 'set' element MUST contain only a 'prop' element.
4922 The elements contained by the 'prop' element inside the 'set'
4923 element MUST specify the name and value of properties that are set
4924 on the resource identified by Request-URI. If a property already
4925 exists, then its value is replaced. Language tagging information
4926 appearing in the scope of the 'prop' element (in the "xml:lang"
4927
4928
4929
4930Dusseault Standards Track [Page 88]
4931
4932RFC 4918 WebDAV June 2007
4933
4934
4935 attribute, if present) MUST be persistently stored along with the
4936 property, and MUST be subsequently retrievable using PROPFIND.
4937
4938 <!ELEMENT set (prop) >
4939
494014.27. shared XML Element
4941
4942 Name: shared
4943
4944 Purpose: Specifies a shared lock.
4945
4946
4947 <!ELEMENT shared EMPTY >
4948
4949
495014.28. status XML Element
4951
4952 Name: status
4953
4954 Purpose: Holds a single HTTP status-line.
4955
4956 Value: status-line (defined in Section 6.1 of [RFC2616])
4957
4958 <!ELEMENT status (#PCDATA) >
4959
496014.29. timeout XML Element
4961
4962 Name: timeout
4963
4964 Purpose: The number of seconds remaining before a lock expires.
4965
4966 Value: TimeType (defined in Section 10.7)
4967
4968
4969 <!ELEMENT timeout (#PCDATA) >
4970
497114.30. write XML Element
4972
4973 Name: write
4974
4975 Purpose: Specifies a write lock.
4976
4977
4978 <!ELEMENT write EMPTY >
4979
4980
4981
4982
4983
4984
4985
4986Dusseault Standards Track [Page 89]
4987
4988RFC 4918 WebDAV June 2007
4989
4990
499115. DAV Properties
4992
4993 For DAV properties, the name of the property is also the same as the
4994 name of the XML element that contains its value. In the section
4995 below, the final line of each section gives the element type
4996 declaration using the format defined in [REC-XML]. The "Value"
4997 field, where present, specifies further restrictions on the allowable
4998 contents of the XML element using BNF (i.e., to further restrict the
4999 values of a PCDATA element).
5000
5001 A protected property is one that cannot be changed with a PROPPATCH
5002 request. There may be other requests that would result in a change
5003 to a protected property (as when a LOCK request affects the value of
5004 DAV:lockdiscovery). Note that a given property could be protected on
5005 one type of resource, but not protected on another type of resource.
5006
5007 A computed property is one with a value defined in terms of a
5008 computation (based on the content and other properties of that
5009 resource, or even of some other resource). A computed property is
5010 always a protected property.
5011
5012 COPY and MOVE behavior refers to local COPY and MOVE operations.
5013
5014 For properties defined based on HTTP GET response headers (DAV:get*),
5015 the header value could include LWS as defined in [RFC2616], Section
5016 4.2. Server implementors SHOULD strip LWS from these values before
5017 using as WebDAV property values.
5018
501915.1. creationdate Property
5020
5021 Name: creationdate
5022
5023 Purpose: Records the time and date the resource was created.
5024
5025 Value: date-time (defined in [RFC3339], see the ABNF in Section
5026 5.6.)
5027
5028 Protected: MAY be protected. Some servers allow DAV:creationdate
5029 to be changed to reflect the time the document was created if that
5030 is more meaningful to the user (rather than the time it was
5031 uploaded). Thus, clients SHOULD NOT use this property in
5032 synchronization logic (use DAV:getetag instead).
5033
5034 COPY/MOVE behavior: This property value SHOULD be kept during a
5035 MOVE operation, but is normally re-initialized when a resource is
5036 created with a COPY. It should not be set in a COPY.
5037
5038
5039
5040
5041
5042Dusseault Standards Track [Page 90]
5043
5044RFC 4918 WebDAV June 2007
5045
5046
5047 Description: The DAV:creationdate property SHOULD be defined on all
5048 DAV compliant resources. If present, it contains a timestamp of
5049 the moment when the resource was created. Servers that are
5050 incapable of persistently recording the creation date SHOULD
5051 instead leave it undefined (i.e. report "Not Found").
5052
5053 <!ELEMENT creationdate (#PCDATA) >
5054
505515.2. displayname Property
5056
5057 Name: displayname
5058
5059 Purpose: Provides a name for the resource that is suitable for
5060 presentation to a user.
5061
5062 Value: Any text.
5063
5064 Protected: SHOULD NOT be protected. Note that servers implementing
5065 [RFC2518] might have made this a protected property as this is a
5066 new requirement.
5067
5068 COPY/MOVE behavior: This property value SHOULD be preserved in COPY
5069 and MOVE operations.
5070
5071 Description: Contains a description of the resource that is
5072 suitable for presentation to a user. This property is defined on
5073 the resource, and hence SHOULD have the same value independent of
5074 the Request-URI used to retrieve it (thus, computing this property
5075 based on the Request-URI is deprecated). While generic clients
5076 might display the property value to end users, client UI designers
5077 must understand that the method for identifying resources is still
5078 the URL. Changes to DAV:displayname do not issue moves or copies
5079 to the server, but simply change a piece of meta-data on the
5080 individual resource. Two resources can have the same DAV:
5081 displayname value even within the same collection.
5082
5083 <!ELEMENT displayname (#PCDATA) >
5084
508515.3. getcontentlanguage Property
5086
5087 Name: getcontentlanguage
5088
5089 Purpose: Contains the Content-Language header value (from Section
5090 14.12 of [RFC2616]) as it would be returned by a GET without
5091 accept headers.
5092
5093 Value: language-tag (language-tag is defined in Section 3.10 of
5094 [RFC2616])
5095
5096
5097
5098Dusseault Standards Track [Page 91]
5099
5100RFC 4918 WebDAV June 2007
5101
5102
5103 Protected: SHOULD NOT be protected, so that clients can reset the
5104 language. Note that servers implementing [RFC2518] might have
5105 made this a protected property as this is a new requirement.
5106
5107 COPY/MOVE behavior: This property value SHOULD be preserved in COPY
5108 and MOVE operations.
5109
5110 Description: The DAV:getcontentlanguage property MUST be defined on
5111 any DAV-compliant resource that returns the Content-Language
5112 header on a GET.
5113
5114 <!ELEMENT getcontentlanguage (#PCDATA) >
5115
511615.4. getcontentlength Property
5117
5118 Name: getcontentlength
5119
5120 Purpose: Contains the Content-Length header returned by a GET
5121 without accept headers.
5122
5123 Value: See Section 14.13 of [RFC2616].
5124
5125 Protected: This property is computed, therefore protected.
5126
5127 Description: The DAV:getcontentlength property MUST be defined on
5128 any DAV-compliant resource that returns the Content-Length header
5129 in response to a GET.
5130
5131 COPY/MOVE behavior: This property value is dependent on the size of
5132 the destination resource, not the value of the property on the
5133 source resource.
5134
5135 <!ELEMENT getcontentlength (#PCDATA) >
5136
513715.5. getcontenttype Property
5138
5139 Name: getcontenttype
5140
5141 Purpose: Contains the Content-Type header value (from Section 14.17
5142 of [RFC2616]) as it would be returned by a GET without accept
5143 headers.
5144
5145 Value: media-type (defined in Section 3.7 of [RFC2616])
5146
5147 Protected: Potentially protected if the server prefers to assign
5148 content types on its own (see also discussion in Section 9.7.1).
5149
5150
5151
5152
5153
5154Dusseault Standards Track [Page 92]
5155
5156RFC 4918 WebDAV June 2007
5157
5158
5159 COPY/MOVE behavior: This property value SHOULD be preserved in COPY
5160 and MOVE operations.
5161
5162 Description: This property MUST be defined on any DAV-compliant
5163 resource that returns the Content-Type header in response to a
5164 GET.
5165
5166 <!ELEMENT getcontenttype (#PCDATA) >
5167
516815.6. getetag Property
5169
5170 Name: getetag
5171
5172 Purpose: Contains the ETag header value (from Section 14.19 of
5173 [RFC2616]) as it would be returned by a GET without accept
5174 headers.
5175
5176 Value: entity-tag (defined in Section 3.11 of [RFC2616])
5177
5178 Protected: MUST be protected because this value is created and
5179 controlled by the server.
5180
5181 COPY/MOVE behavior: This property value is dependent on the final
5182 state of the destination resource, not the value of the property
5183 on the source resource. Also note the considerations in
5184 Section 8.8.
5185
5186 Description: The getetag property MUST be defined on any DAV-
5187 compliant resource that returns the Etag header. Refer to Section
5188 3.11 of RFC 2616 for a complete definition of the semantics of an
5189 ETag, and to Section 8.6 for a discussion of ETags in WebDAV.
5190
5191 <!ELEMENT getetag (#PCDATA) >
5192
519315.7. getlastmodified Property
5194
5195 Name: getlastmodified
5196
5197 Purpose: Contains the Last-Modified header value (from Section
5198 14.29 of [RFC2616]) as it would be returned by a GET method
5199 without accept headers.
5200
5201 Value: rfc1123-date (defined in Section 3.3.1 of [RFC2616])
5202
5203 Protected: SHOULD be protected because some clients may rely on the
5204 value for appropriate caching behavior, or on the value of the
5205 Last-Modified header to which this property is linked.
5206
5207
5208
5209
5210Dusseault Standards Track [Page 93]
5211
5212RFC 4918 WebDAV June 2007
5213
5214
5215 COPY/MOVE behavior: This property value is dependent on the last
5216 modified date of the destination resource, not the value of the
5217 property on the source resource. Note that some server
5218 implementations use the file system date modified value for the
5219 DAV:getlastmodified value, and this can be preserved in a MOVE
5220 even when the HTTP Last-Modified value SHOULD change. Note that
5221 since [RFC2616] requires clients to use ETags where provided, a
5222 server implementing ETags can count on clients using a much better
5223 mechanism than modification dates for offline synchronization or
5224 cache control. Also note the considerations in Section 8.8.
5225
5226 Description: The last-modified date on a resource SHOULD only
5227 reflect changes in the body (the GET responses) of the resource.
5228 A change in a property only SHOULD NOT cause the last-modified
5229 date to change, because clients MAY rely on the last-modified date
5230 to know when to overwrite the existing body. The DAV:
5231 getlastmodified property MUST be defined on any DAV-compliant
5232 resource that returns the Last-Modified header in response to a
5233 GET.
5234
5235 <!ELEMENT getlastmodified (#PCDATA) >
5236
523715.8. lockdiscovery Property
5238
5239 Name: lockdiscovery
5240
5241 Purpose: Describes the active locks on a resource
5242
5243 Protected: MUST be protected. Clients change the list of locks
5244 through LOCK and UNLOCK, not through PROPPATCH.
5245
5246 COPY/MOVE behavior: The value of this property depends on the lock
5247 state of the destination, not on the locks of the source resource.
5248 Recall that locks are not moved in a MOVE operation.
5249
5250 Description: Returns a listing of who has a lock, what type of lock
5251 he has, the timeout type and the time remaining on the timeout,
5252 and the associated lock token. Owner information MAY be omitted
5253 if it is considered sensitive. If there are no locks, but the
5254 server supports locks, the property will be present but contain
5255 zero 'activelock' elements. If there are one or more locks, an
5256 'activelock' element appears for each lock on the resource. This
5257 property is NOT lockable with respect to write locks (Section 7).
5258
5259 <!ELEMENT lockdiscovery (activelock)* >
5260
5261
5262
5263
5264
5265
5266Dusseault Standards Track [Page 94]
5267
5268RFC 4918 WebDAV June 2007
5269
5270
527115.8.1. Example - Retrieving DAV:lockdiscovery
5272
5273 >>Request
5274
5275 PROPFIND /container/ HTTP/1.1
5276 Host: www.example.com
5277 Content-Length: xxxx
5278 Content-Type: application/xml; charset="utf-8"
5279
5280 <?xml version="1.0" encoding="utf-8" ?>
5281 <D:propfind xmlns:D='DAV:'>
5282 <D:prop><D:lockdiscovery/></D:prop>
5283 </D:propfind>
5284
5285 >>Response
5286
5287 HTTP/1.1 207 Multi-Status
5288 Content-Type: application/xml; charset="utf-8"
5289 Content-Length: xxxx
5290
5291 <?xml version="1.0" encoding="utf-8" ?>
5292 <D:multistatus xmlns:D='DAV:'>
5293 <D:response>
5294 <D:href>http://www.example.com/container/</D:href>
5295 <D:propstat>
5296 <D:prop>
5297 <D:lockdiscovery>
5298 <D:activelock>
5299 <D:locktype><D:write/></D:locktype>
5300 <D:lockscope><D:exclusive/></D:lockscope>
5301 <D:depth>0</D:depth>
5302 <D:owner>Jane Smith</D:owner>
5303 <D:timeout>Infinite</D:timeout>
5304 <D:locktoken>
5305 <D:href
5306 >urn:uuid:f81de2ad-7f3d-a1b2-4f3c-00a0c91a9d76</D:href>
5307 </D:locktoken>
5308 <D:lockroot>
5309 <D:href>http://www.example.com/container/</D:href>
5310 </D:lockroot>
5311 </D:activelock>
5312 </D:lockdiscovery>
5313 </D:prop>
5314 <D:status>HTTP/1.1 200 OK</D:status>
5315 </D:propstat>
5316 </D:response>
5317 </D:multistatus>
5318
5319
5320
5321
5322Dusseault Standards Track [Page 95]
5323
5324RFC 4918 WebDAV June 2007
5325
5326
5327 This resource has a single exclusive write lock on it, with an
5328 infinite timeout.
5329
533015.9. resourcetype Property
5331
5332 Name: resourcetype
5333
5334 Purpose: Specifies the nature of the resource.
5335
5336 Protected: SHOULD be protected. Resource type is generally decided
5337 through the operation creating the resource (MKCOL vs PUT), not by
5338 PROPPATCH.
5339
5340 COPY/MOVE behavior: Generally a COPY/MOVE of a resource results in
5341 the same type of resource at the destination.
5342
5343 Description: MUST be defined on all DAV-compliant resources. Each
5344 child element identifies a specific type the resource belongs to,
5345 such as 'collection', which is the only resource type defined by
5346 this specification (see Section 14.3). If the element contains
5347 the 'collection' child element plus additional unrecognized
5348 elements, it should generally be treated as a collection. If the
5349 element contains no recognized child elements, it should be
5350 treated as a non-collection resource. The default value is empty.
5351 This element MUST NOT contain text or mixed content. Any custom
5352 child element is considered to be an identifier for a resource
5353 type.
5354
5355 Example: (fictional example to show extensibility)
5356
5357 <x:resourcetype xmlns:x="DAV:">
5358 <x:collection/>
5359 <f:search-results xmlns:f="http://www.example.com/ns"/>
5360 </x:resourcetype>
5361
536215.10. supportedlock Property
5363
5364 Name: supportedlock
5365
5366 Purpose: To provide a listing of the lock capabilities supported by
5367 the resource.
5368
5369 Protected: MUST be protected. Servers, not clients, determine what
5370 lock mechanisms are supported.
5371
5372
5373
5374
5375
5376
5377
5378Dusseault Standards Track [Page 96]
5379
5380RFC 4918 WebDAV June 2007
5381
5382
5383 COPY/MOVE behavior: This property value is dependent on the kind of
5384 locks supported at the destination, not on the value of the
5385 property at the source resource. Servers attempting to COPY to a
5386 destination should not attempt to set this property at the
5387 destination.
5388
5389 Description: Returns a listing of the combinations of scope and
5390 access types that may be specified in a lock request on the
5391 resource. Note that the actual contents are themselves controlled
5392 by access controls, so a server is not required to provide
5393 information the client is not authorized to see. This property is
5394 NOT lockable with respect to write locks (Section 7).
5395
5396 <!ELEMENT supportedlock (lockentry)* >
5397
539815.10.1. Example - Retrieving DAV:supportedlock
5399
5400 >>Request
5401
5402 PROPFIND /container/ HTTP/1.1
5403 Host: www.example.com
5404 Content-Length: xxxx
5405 Content-Type: application/xml; charset="utf-8"
5406
5407 <?xml version="1.0" encoding="utf-8" ?>
5408 <D:propfind xmlns:D="DAV:">
5409 <D:prop><D:supportedlock/></D:prop>
5410 </D:propfind>
5411
5412 >>Response
5413
5414 HTTP/1.1 207 Multi-Status
5415 Content-Type: application/xml; charset="utf-8"
5416 Content-Length: xxxx
5417
5418 <?xml version="1.0" encoding="utf-8" ?>
5419 <D:multistatus xmlns:D="DAV:">
5420 <D:response>
5421 <D:href>http://www.example.com/container/</D:href>
5422 <D:propstat>
5423 <D:prop>
5424 <D:supportedlock>
5425 <D:lockentry>
5426 <D:lockscope><D:exclusive/></D:lockscope>
5427 <D:locktype><D:write/></D:locktype>
5428 </D:lockentry>
5429 <D:lockentry>
5430 <D:lockscope><D:shared/></D:lockscope>
5431
5432
5433
5434Dusseault Standards Track [Page 97]
5435
5436RFC 4918 WebDAV June 2007
5437
5438
5439 <D:locktype><D:write/></D:locktype>
5440 </D:lockentry>
5441 </D:supportedlock>
5442 </D:prop>
5443 <D:status>HTTP/1.1 200 OK</D:status>
5444 </D:propstat>
5445 </D:response>
5446 </D:multistatus>
5447
544816. Precondition/Postcondition XML Elements
5449
5450 As introduced in Section 8.7, extra information on error conditions
5451 can be included in the body of many status responses. This section
5452 makes requirements on the use of the error body mechanism and
5453 introduces a number of precondition and postcondition codes.
5454
5455 A "precondition" of a method describes the state of the server that
5456 must be true for that method to be performed. A "postcondition" of a
5457 method describes the state of the server that must be true after that
5458 method has been completed.
5459
5460 Each precondition and postcondition has a unique XML element
5461 associated with it. In a 207 Multi-Status response, the XML element
5462 MUST appear inside an 'error' element in the appropriate 'propstat or
5463 'response' element depending on whether the condition applies to one
5464 or more properties or to the resource as a whole. In all other error
5465 responses where this specification's 'error' body is used, the
5466 precondition/postcondition XML element MUST be returned as the child
5467 of a top-level 'error' element in the response body, unless otherwise
5468 negotiated by the request, along with an appropriate response status.
5469 The most common response status codes are 403 (Forbidden) if the
5470 request should not be repeated because it will always fail, and 409
5471 (Conflict) if it is expected that the user might be able to resolve
5472 the conflict and resubmit the request. The 'error' element MAY
5473 contain child elements with specific error information and MAY be
5474 extended with any custom child elements.
5475
5476 This mechanism does not take the place of using a correct numeric
5477 status code as defined here or in HTTP, because the client must
5478 always be able to take a reasonable course of action based only on
5479 the numeric code. However, it does remove the need to define new
5480 numeric codes. The new machine-readable codes used for this purpose
5481 are XML elements classified as preconditions and postconditions, so
5482 naturally, any group defining a new condition code can use their own
5483 namespace. As always, the "DAV:" namespace is reserved for use by
5484 IETF-chartered WebDAV working groups.
5485
5486
5487
5488
5489
5490Dusseault Standards Track [Page 98]
5491
5492RFC 4918 WebDAV June 2007
5493
5494
5495 A server supporting this specification SHOULD use the XML error
5496 whenever a precondition or postcondition defined in this document is
5497 violated. For error conditions not specified in this document, the
5498 server MAY simply choose an appropriate numeric status and leave the
5499 response body blank. However, a server MAY instead use a custom
5500 condition code and other supporting text, because even when clients
5501 do not automatically recognize condition codes, they can be quite
5502 useful in interoperability testing and debugging.
5503
5504 Example - Response with precondition code
5505
5506 >>Response
5507
5508 HTTP/1.1 423 Locked
5509 Content-Type: application/xml; charset="utf-8"
5510 Content-Length: xxxx
5511
5512 <?xml version="1.0" encoding="utf-8" ?>
5513 <D:error xmlns:D="DAV:">
5514 <D:lock-token-submitted>
5515 <D:href>/workspace/webdav/</D:href>
5516 </D:lock-token-submitted>
5517 </D:error>
5518
5519 In this example, a client unaware of a depth-infinity lock on the
5520 parent collection "/workspace/webdav/" attempted to modify the
5521 collection member "/workspace/webdav/proposal.doc".
5522
5523 Some other useful preconditions and postconditions have been defined
5524 in other specifications extending WebDAV, such as [RFC3744] (see
5525 particularly Section 7.1.1), [RFC3253], and [RFC3648].
5526
5527 All these elements are in the "DAV:" namespace. If not specified
5528 otherwise, the content for each condition's XML element is defined to
5529 be empty.
5530
5531
5532 Name: lock-token-matches-request-uri
5533
5534 Use with: 409 Conflict
5535
5536 Purpose: (precondition) -- A request may include a Lock-Token header
5537 to identify a lock for the UNLOCK method. However, if the
5538 Request-URI does not fall within the scope of the lock identified
5539 by the token, the server SHOULD use this error. The lock may have
5540 a scope that does not include the Request-URI, or the lock could
5541 have disappeared, or the token may be invalid.
5542
5543
5544
5545
5546Dusseault Standards Track [Page 99]
5547
5548RFC 4918 WebDAV June 2007
5549
5550
5551 Name: lock-token-submitted (precondition)
5552
5553 Use with: 423 Locked
5554
5555 Purpose: The request could not succeed because a lock token should
5556 have been submitted. This element, if present, MUST contain at
5557 least one URL of a locked resource that prevented the request. In
5558 cases of MOVE, COPY, and DELETE where collection locks are
5559 involved, it can be difficult for the client to find out which
5560 locked resource made the request fail -- but the server is only
5561 responsible for returning one such locked resource. The server
5562 MAY return every locked resource that prevented the request from
5563 succeeding if it knows them all.
5564
5565 <!ELEMENT lock-token-submitted (href+) >
5566
5567
5568 Name: no-conflicting-lock (precondition)
5569
5570 Use with: Typically 423 Locked
5571
5572 Purpose: A LOCK request failed due the presence of an already
5573 existing conflicting lock. Note that a lock can be in conflict
5574 although the resource to which the request was directed is only
5575 indirectly locked. In this case, the precondition code can be
5576 used to inform the client about the resource that is the root of
5577 the conflicting lock, avoiding a separate lookup of the
5578 "lockdiscovery" property.
5579
5580 <!ELEMENT no-conflicting-lock (href)* >
5581
5582
5583 Name: no-external-entities
5584
5585 Use with: 403 Forbidden
5586
5587 Purpose: (precondition) -- If the server rejects a client request
5588 because the request body contains an external entity, the server
5589 SHOULD use this error.
5590
5591
5592 Name: preserved-live-properties
5593
5594 Use with: 409 Conflict
5595
5596 Purpose: (postcondition) -- The server received an otherwise-valid
5597 MOVE or COPY request, but cannot maintain the live properties with
5598 the same behavior at the destination. It may be that the server
5599
5600
5601
5602Dusseault Standards Track [Page 100]
5603
5604RFC 4918 WebDAV June 2007
5605
5606
5607 only supports some live properties in some parts of the
5608 repository, or simply has an internal error.
5609
5610
5611 Name: propfind-finite-depth
5612
5613 Use with: 403 Forbidden
5614
5615 Purpose: (precondition) -- This server does not allow infinite-depth
5616 PROPFIND requests on collections.
5617
5618
5619 Name: cannot-modify-protected-property
5620
5621 Use with: 403 Forbidden
5622
5623 Purpose: (precondition) -- The client attempted to set a protected
5624 property in a PROPPATCH (such as DAV:getetag). See also
5625 [RFC3253], Section 3.12.
5626
562717. XML Extensibility in DAV
5628
5629 The XML namespace extension ([REC-XML-NAMES]) is used in this
5630 specification in order to allow for new XML elements to be added
5631 without fear of colliding with other element names. Although WebDAV
5632 request and response bodies can be extended by arbitrary XML
5633 elements, which can be ignored by the message recipient, an XML
5634 element in the "DAV:" namespace SHOULD NOT be used in the request or
5635 response body unless that XML element is explicitly defined in an
5636 IETF RFC reviewed by a WebDAV working group.
5637
5638 For WebDAV to be both extensible and backwards-compatible, both
5639 clients and servers need to know how to behave when unexpected or
5640 unrecognized command extensions are received. For XML processing,
5641 this means that clients and servers MUST process received XML
5642 documents as if unexpected elements and attributes (and all children
5643 of unrecognized elements) were not there. An unexpected element or
5644 attribute includes one that may be used in another context but is not
5645 expected here. Ignoring such items for purposes of processing can of
5646 course be consistent with logging all information or presenting for
5647 debugging.
5648
5649 This restriction also applies to the processing, by clients, of DAV
5650 property values where unexpected XML elements SHOULD be ignored
5651 unless the property's schema declares otherwise.
5652
5653 This restriction does not apply to setting dead DAV properties on the
5654 server where the server MUST record all XML elements.
5655
5656
5657
5658Dusseault Standards Track [Page 101]
5659
5660RFC 4918 WebDAV June 2007
5661
5662
5663 Additionally, this restriction does not apply to the use of XML where
5664 XML happens to be the content type of the entity body, for example,
5665 when used as the body of a PUT.
5666
5667 Processing instructions in XML SHOULD be ignored by recipients.
5668 Thus, specifications extending WebDAV SHOULD NOT use processing
5669 instructions to define normative behavior.
5670
5671 XML DTD fragments are included for all the XML elements defined in
5672 this specification. However, correct XML will not be valid according
5673 to any DTD due to namespace usage and extension rules. In
5674 particular:
5675
5676 o Elements (from this specification) are in the "DAV:" namespace,
5677
5678 o Element ordering is irrelevant unless otherwise stated,
5679
5680 o Extension attributes MAY be added,
5681
5682 o For element type definitions of "ANY", the normative text
5683 definition for that element defines what can be in it and what
5684 that means.
5685
5686 o For element type definitions of "#PCDATA", extension elements MUST
5687 NOT be added.
5688
5689 o For other element type definitions, including "EMPTY", extension
5690 elements MAY be added.
5691
5692 Note that this means that elements containing elements cannot be
5693 extended to contain text, and vice versa.
5694
5695 With DTD validation relaxed by the rules above, the constraints
5696 described by the DTD fragments are normative (see for example
5697 Appendix A). A recipient of a WebDAV message with an XML body MUST
5698 NOT validate the XML document according to any hard-coded or
5699 dynamically-declared DTD.
5700
5701 Note that this section describes backwards-compatible extensibility
5702 rules. There might also be times when an extension is designed not
5703 to be backwards-compatible, for example, defining an extension that
5704 reuses an XML element defined in this document but omitting one of
5705 the child elements required by the DTDs in this specification.
5706
5707
5708
5709
5710
5711
5712
5713
5714Dusseault Standards Track [Page 102]
5715
5716RFC 4918 WebDAV June 2007
5717
5718
571918. DAV Compliance Classes
5720
5721 A DAV-compliant resource can advertise several classes of compliance.
5722 A client can discover the compliance classes of a resource by
5723 executing OPTIONS on the resource and examining the "DAV" header
5724 which is returned. Note particularly that resources, rather than
5725 servers, are spoken of as being compliant. That is because
5726 theoretically some resources on a server could support different
5727 feature sets. For example, a server could have a sub-repository
5728 where an advanced feature like versioning was supported, even if that
5729 feature was not supported on all sub-repositories.
5730
5731 Since this document describes extensions to the HTTP/1.1 protocol,
5732 minimally all DAV-compliant resources, clients, and proxies MUST be
5733 compliant with [RFC2616].
5734
5735 A resource that is class 2 or class 3 compliant must also be class 1
5736 compliant.
5737
573818.1. Class 1
5739
5740 A class 1 compliant resource MUST meet all "MUST" requirements in all
5741 sections of this document.
5742
5743 Class 1 compliant resources MUST return, at minimum, the value "1" in
5744 the DAV header on all responses to the OPTIONS method.
5745
574618.2. Class 2
5747
5748 A class 2 compliant resource MUST meet all class 1 requirements and
5749 support the LOCK method, the DAV:supportedlock property, the DAV:
5750 lockdiscovery property, the Time-Out response header and the Lock-
5751 Token request header. A class 2 compliant resource SHOULD also
5752 support the Timeout request header and the 'owner' XML element.
5753
5754 Class 2 compliant resources MUST return, at minimum, the values "1"
5755 and "2" in the DAV header on all responses to the OPTIONS method.
5756
575718.3. Class 3
5758
5759 A resource can explicitly advertise its support for the revisions to
5760 [RFC2518] made in this document. Class 1 MUST be supported as well.
5761 Class 2 MAY be supported. Advertising class 3 support in addition to
5762 class 1 and 2 means that the server supports all the requirements in
5763 this specification. Advertising class 3 and class 1 support, but not
5764 class 2, means that the server supports all the requirements in this
5765 specification except possibly those that involve locking support.
5766
5767
5768
5769
5770Dusseault Standards Track [Page 103]
5771
5772RFC 4918 WebDAV June 2007
5773
5774
5775 Example:
5776
5777 DAV: 1, 3
5778
577919. Internationalization Considerations
5780
5781 In the realm of internationalization, this specification complies
5782 with the IETF Character Set Policy [RFC2277]. In this specification,
5783 human-readable fields can be found either in the value of a property,
5784 or in an error message returned in a response entity body. In both
5785 cases, the human-readable content is encoded using XML, which has
5786 explicit provisions for character set tagging and encoding, and
5787 requires that XML processors read XML elements encoded, at minimum,
5788 using the UTF-8 [RFC3629] and UTF-16 [RFC2781] encodings of the ISO
5789 10646 multilingual plane. XML examples in this specification
5790 demonstrate use of the charset parameter of the Content-Type header
5791 (defined in [RFC3023]), as well as XML charset declarations.
5792
5793 XML also provides a language tagging capability for specifying the
5794 language of the contents of a particular XML element. The "xml:lang"
5795 attribute appears on an XML element to identify the language of its
5796 content and attributes. See [REC-XML] for definitions of values and
5797 scoping.
5798
5799 WebDAV applications MUST support the character set tagging, character
5800 set encoding, and the language tagging functionality of the XML
5801 specification. Implementors of WebDAV applications are strongly
5802 encouraged to read "XML Media Types" [RFC3023] for instruction on
5803 which MIME media type to use for XML transport, and on use of the
5804 charset parameter of the Content-Type header.
5805
5806 Names used within this specification fall into four categories: names
5807 of protocol elements such as methods and headers, names of XML
5808 elements, names of properties, and names of conditions. Naming of
5809 protocol elements follows the precedent of HTTP, using English names
5810 encoded in US-ASCII for methods and headers. Since these protocol
5811 elements are not visible to users, and are simply long token
5812 identifiers, they do not need to support multiple languages.
5813 Similarly, the names of XML elements used in this specification are
5814 not visible to the user and hence do not need to support multiple
5815 languages.
5816
5817 WebDAV property names are qualified XML names (pairs of XML namespace
5818 name and local name). Although some applications (e.g., a generic
5819 property viewer) will display property names directly to their users,
5820 it is expected that the typical application will use a fixed set of
5821 properties, and will provide a mapping from the property name and
5822 namespace to a human-readable field when displaying the property name
5823
5824
5825
5826Dusseault Standards Track [Page 104]
5827
5828RFC 4918 WebDAV June 2007
5829
5830
5831 to a user. It is only in the case where the set of properties is not
5832 known ahead of time that an application need display a property name
5833 to a user. We recommend that applications provide human-readable
5834 property names wherever feasible.
5835
5836 For error reporting, we follow the convention of HTTP/1.1 status
5837 codes, including with each status code a short, English description
5838 of the code (e.g., 423 (Locked)). While the possibility exists that
5839 a poorly crafted user agent would display this message to a user,
5840 internationalized applications will ignore this message, and display
5841 an appropriate message in the user's language and character set.
5842
5843 Since interoperation of clients and servers does not require locale
5844 information, this specification does not specify any mechanism for
5845 transmission of this information.
5846
584720. Security Considerations
5848
5849 This section is provided to detail issues concerning security
5850 implications of which WebDAV applications need to be aware.
5851
5852 All of the security considerations of HTTP/1.1 (discussed in
5853 [RFC2616]) and XML (discussed in [RFC3023]) also apply to WebDAV. In
5854 addition, the security risks inherent in remote authoring require
5855 stronger authentication technology, introduce several new privacy
5856 concerns, and may increase the hazards from poor server design.
5857 These issues are detailed below.
5858
585920.1. Authentication of Clients
5860
5861 Due to their emphasis on authoring, WebDAV servers need to use
5862 authentication technology to protect not just access to a network
5863 resource, but the integrity of the resource as well. Furthermore,
5864 the introduction of locking functionality requires support for
5865 authentication.
5866
5867 A password sent in the clear over an insecure channel is an
5868 inadequate means for protecting the accessibility and integrity of a
5869 resource as the password may be intercepted. Since Basic
5870 authentication for HTTP/1.1 performs essentially clear text
5871 transmission of a password, Basic authentication MUST NOT be used to
5872 authenticate a WebDAV client to a server unless the connection is
5873 secure. Furthermore, a WebDAV server MUST NOT send a Basic
5874 authentication challenge in a WWW-Authenticate header unless the
5875 connection is secure. An example of a secure connection would be a
5876 Transport Layer Security (TLS) connection employing a strong cipher
5877 suite and server authentication.
5878
5879
5880
5881
5882Dusseault Standards Track [Page 105]
5883
5884RFC 4918 WebDAV June 2007
5885
5886
5887 WebDAV applications MUST support the Digest authentication scheme
5888 [RFC2617]. Since Digest authentication verifies that both parties to
5889 a communication know a shared secret, a password, without having to
5890 send that secret in the clear, Digest authentication avoids the
5891 security problems inherent in Basic authentication while providing a
5892 level of authentication that is useful in a wide range of scenarios.
5893
589420.2. Denial of Service
5895
5896 Denial-of-service attacks are of special concern to WebDAV servers.
5897 WebDAV plus HTTP enables denial-of-service attacks on every part of a
5898 system's resources.
5899
5900 o The underlying storage can be attacked by PUTting extremely large
5901 files.
5902
5903 o Asking for recursive operations on large collections can attack
5904 processing time.
5905
5906 o Making multiple pipelined requests on multiple connections can
5907 attack network connections.
5908
5909 WebDAV servers need to be aware of the possibility of a denial-of-
5910 service attack at all levels. The proper response to such an attack
5911 MAY be to simply drop the connection. Or, if the server is able to
5912 make a response, the server MAY use a 400-level status request such
5913 as 400 (Bad Request) and indicate why the request was refused (a 500-
5914 level status response would indicate that the problem is with the
5915 server, whereas unintentional DoS attacks are something the client is
5916 capable of remedying).
5917
591820.3. Security through Obscurity
5919
5920 WebDAV provides, through the PROPFIND method, a mechanism for listing
5921 the member resources of a collection. This greatly diminishes the
5922 effectiveness of security or privacy techniques that rely only on the
5923 difficulty of discovering the names of network resources. Users of
5924 WebDAV servers are encouraged to use access control techniques to
5925 prevent unwanted access to resources, rather than depending on the
5926 relative obscurity of their resource names.
5927
592820.4. Privacy Issues Connected to Locks
5929
5930 When submitting a lock request, a user agent may also submit an
5931 'owner' XML field giving contact information for the person taking
5932 out the lock (for those cases where a person, rather than a robot, is
5933 taking out the lock). This contact information is stored in a DAV:
5934 lockdiscovery property on the resource, and can be used by other
5935
5936
5937
5938Dusseault Standards Track [Page 106]
5939
5940RFC 4918 WebDAV June 2007
5941
5942
5943 collaborators to begin negotiation over access to the resource.
5944 However, in many cases, this contact information can be very private,
5945 and should not be widely disseminated. Servers SHOULD limit read
5946 access to the DAV:lockdiscovery property as appropriate.
5947 Furthermore, user agents SHOULD provide control over whether contact
5948 information is sent at all, and if contact information is sent,
5949 control over exactly what information is sent.
5950
595120.5. Privacy Issues Connected to Properties
5952
5953 Since property values are typically used to hold information such as
5954 the author of a document, there is the possibility that privacy
5955 concerns could arise stemming from widespread access to a resource's
5956 property data. To reduce the risk of inadvertent release of private
5957 information via properties, servers are encouraged to develop access
5958 control mechanisms that separate read access to the resource body and
5959 read access to the resource's properties. This allows a user to
5960 control the dissemination of their property data without overly
5961 restricting access to the resource's contents.
5962
596320.6. Implications of XML Entities
5964
5965 XML supports a facility known as "external entities", defined in
5966 Section 4.2.2 of [REC-XML], which instructs an XML processor to
5967 retrieve and include additional XML. An external XML entity can be
5968 used to append or modify the document type declaration (DTD)
5969 associated with an XML document. An external XML entity can also be
5970 used to include XML within the content of an XML document. For non-
5971 validating XML, such as the XML used in this specification, including
5972 an external XML entity is not required by XML. However, XML does
5973 state that an XML processor may, at its discretion, include the
5974 external XML entity.
5975
5976 External XML entities have no inherent trustworthiness and are
5977 subject to all the attacks that are endemic to any HTTP GET request.
5978 Furthermore, it is possible for an external XML entity to modify the
5979 DTD, and hence affect the final form of an XML document, in the worst
5980 case, significantly modifying its semantics or exposing the XML
5981 processor to the security risks discussed in [RFC3023]. Therefore,
5982 implementers must be aware that external XML entities should be
5983 treated as untrustworthy. If a server chooses not to handle external
5984 XML entities, it SHOULD respond to requests containing external
5985 entities with the 'no-external-entities' condition code.
5986
5987 There is also the scalability risk that would accompany a widely
5988 deployed application that made use of external XML entities. In this
5989 situation, it is possible that there would be significant numbers of
5990 requests for one external XML entity, potentially overloading any
5991
5992
5993
5994Dusseault Standards Track [Page 107]
5995
5996RFC 4918 WebDAV June 2007
5997
5998
5999 server that fields requests for the resource containing the external
6000 XML entity.
6001
6002 Furthermore, there's also a risk based on the evaluation of "internal
6003 entities" as defined in Section 4.2.2 of [REC-XML]. A small,
6004 carefully crafted request using nested internal entities may require
6005 enormous amounts of memory and/or processing time to process. Server
6006 implementers should be aware of this risk and configure their XML
6007 parsers so that requests like these can be detected and rejected as
6008 early as possible.
6009
601020.7. Risks Connected with Lock Tokens
6011
6012 This specification encourages the use of "A Universally Unique
6013 Identifier (UUID) URN Namespace" ([RFC4122]) for lock tokens
6014 (Section 6.5), in order to guarantee their uniqueness across space
6015 and time. Version 1 UUIDs (defined in Section 4) MAY contain a
6016 "node" field that "consists of an IEEE 802 MAC address, usually the
6017 host address. For systems with multiple IEEE addresses, any
6018 available one can be used". Since a WebDAV server will issue many
6019 locks over its lifetime, the implication is that it may also be
6020 publicly exposing its IEEE 802 address.
6021
6022 There are several risks associated with exposure of IEEE 802
6023 addresses. Using the IEEE 802 address:
6024
6025 o It is possible to track the movement of hardware from subnet to
6026 subnet.
6027
6028 o It may be possible to identify the manufacturer of the hardware
6029 running a WebDAV server.
6030
6031 o It may be possible to determine the number of each type of
6032 computer running WebDAV.
6033
6034 This risk only applies to host-address-based UUID versions. Section
6035 4 of [RFC4122] describes several other mechanisms for generating
6036 UUIDs that do not involve the host address and therefore do not
6037 suffer from this risk.
6038
603920.8. Hosting Malicious Content
6040
6041 HTTP has the ability to host programs that are executed on client
6042 machines. These programs can take many forms including Web scripts,
6043 executables, plug-in modules, and macros in documents. WebDAV does
6044 not change any of the security concerns around these programs, yet
6045 often WebDAV is used in contexts where a wide range of users can
6046 publish documents on a server. The server might not have a close
6047
6048
6049
6050Dusseault Standards Track [Page 108]
6051
6052RFC 4918 WebDAV June 2007
6053
6054
6055 trust relationship with the author that is publishing the document.
6056 Servers that allow clients to publish arbitrary content can usefully
6057 implement precautions to check that content published to the server
6058 is not harmful to other clients. Servers could do this by techniques
6059 such as restricting the types of content that is allowed to be
6060 published and running virus and malware detection software on
6061 published content. Servers can also mitigate the risk by having
6062 appropriate access restriction and authentication of users that are
6063 allowed to publish content to the server.
6064
606521. IANA Considerations
6066
606721.1. New URI Schemes
6068
6069 This specification defines two URI schemes:
6070
6071 1. the "opaquelocktoken" scheme defined in Appendix C, and
6072
6073 2. the "DAV" URI scheme, which historically was used in [RFC2518] to
6074 disambiguate WebDAV property and XML element names and which
6075 continues to be used for that purpose in this specification and
6076 others extending WebDAV. Creation of identifiers in the "DAV:"
6077 namespace is controlled by the IETF.
6078
6079 Note that defining new URI schemes for XML namespaces is now
6080 discouraged. "DAV:" was defined before standard best practices
6081 emerged.
6082
608321.2. XML Namespaces
6084
6085 XML namespaces disambiguate WebDAV property names and XML elements.
6086 Any WebDAV user or application can define a new namespace in order to
6087 create custom properties or extend WebDAV XML syntax. IANA does not
6088 need to manage such namespaces, property names, or element names.
6089
609021.3. Message Header Fields
6091
6092 The message header fields below should be added to the permanent
6093 registry (see [RFC3864]).
6094
609521.3.1. DAV
6096
6097 Header field name: DAV
6098
6099 Applicable protocol: http
6100
6101 Status: standard
6102
6103
6104
6105
6106Dusseault Standards Track [Page 109]
6107
6108RFC 4918 WebDAV June 2007
6109
6110
6111 Author/Change controller: IETF
6112
6113 Specification document: this specification (Section 10.1)
6114
611521.3.2. Depth
6116
6117 Header field name: Depth
6118
6119 Applicable protocol: http
6120
6121 Status: standard
6122
6123 Author/Change controller: IETF
6124
6125 Specification document: this specification (Section 10.2)
6126
612721.3.3. Destination
6128
6129 Header field name: Destination
6130
6131 Applicable protocol: http
6132
6133 Status: standard
6134
6135 Author/Change controller: IETF
6136
6137 Specification document: this specification (Section 10.3)
6138
613921.3.4. If
6140
6141 Header field name: If
6142
6143 Applicable protocol: http
6144
6145 Status: standard
6146
6147 Author/Change controller: IETF
6148
6149 Specification document: this specification (Section 10.4)
6150
615121.3.5. Lock-Token
6152
6153 Header field name: Lock-Token
6154
6155 Applicable protocol: http
6156
6157 Status: standard
6158
6159
6160
6161
6162Dusseault Standards Track [Page 110]
6163
6164RFC 4918 WebDAV June 2007
6165
6166
6167 Author/Change controller: IETF
6168
6169 Specification document: this specification (Section 10.5)
6170
617121.3.6. Overwrite
6172
6173 Header field name: Overwrite
6174
6175 Applicable protocol: http
6176
6177 Status: standard
6178
6179 Author/Change controller: IETF
6180
6181 Specification document: this specification (Section 10.6)
6182
618321.3.7. Timeout
6184
6185 Header field name: Timeout
6186
6187 Applicable protocol: http
6188
6189 Status: standard
6190
6191 Author/Change controller: IETF
6192
6193 Specification document: this specification (Section 10.7)
6194
619521.4. HTTP Status Codes
6196
6197 This specification defines the HTTP status codes
6198
6199 o 207 Multi-Status (Section 11.1)
6200
6201 o 422 Unprocessable Entity (Section 11.2),
6202
6203 o 423 Locked (Section 11.3),
6204
6205 o 424 Failed Dependency (Section 11.4) and
6206
6207 o 507 Insufficient Storage (Section 11.5),
6208
6209 to be updated in the registry at
6210 <http://www.iana.org/assignments/http-status-codes>.
6211
6212 Note: the HTTP status code 102 (Processing) has been removed in this
6213 specification; its IANA registration should continue to reference RFC
6214 2518.
6215
6216
6217
6218Dusseault Standards Track [Page 111]
6219
6220RFC 4918 WebDAV June 2007
6221
6222
622322. Acknowledgements
6224
6225 A specification such as this thrives on piercing critical review and
6226 withers from apathetic neglect. The authors gratefully acknowledge
6227 the contributions of the following people, whose insights were so
6228 valuable at every stage of our work.
6229
6230 Contributors to RFC 2518
6231
6232 Terry Allen, Harald Alvestrand, Jim Amsden, Becky Anderson, Alan
6233 Babich, Sanford Barr, Dylan Barrell, Bernard Chester, Tim Berners-
6234 Lee, Dan Connolly, Jim Cunningham, Ron Daniel, Jr., Jim Davis, Keith
6235 Dawson, Mark Day, Brian Deen, Martin Duerst, David Durand, Lee
6236 Farrell, Chuck Fay, Wesley Felter, Roy Fielding, Mark Fisher, Alan
6237 Freier, George Florentine, Jim Gettys, Phill Hallam-Baker, Dennis
6238 Hamilton, Steve Henning, Mead Himelstein, Alex Hopmann, Andre van der
6239 Hoek, Ben Laurie, Paul Leach, Ora Lassila, Karen MacArthur, Steven
6240 Martin, Larry Masinter, Michael Mealling, Keith Moore, Thomas Narten,
6241 Henrik Nielsen, Kenji Ota, Bob Parker, Glenn Peterson, Jon Radoff,
6242 Saveen Reddy, Henry Sanders, Christopher Seiwald, Judith Slein, Mike
6243 Spreitzer, Einar Stefferud, Greg Stein, Ralph Swick, Kenji Takahashi,
6244 Richard N. Taylor, Robert Thau, John Turner, Sankar Virdhagriswaran,
6245 Fabio Vitali, Gregory Woodhouse, and Lauren Wood.
6246
6247 Two from this list deserve special mention. The contributions by
6248 Larry Masinter have been invaluable; he both helped the formation of
6249 the working group and patiently coached the authors along the way.
6250 In so many ways he has set high standards that we have toiled to
6251 meet. The contributions of Judith Slein were also invaluable; by
6252 clarifying the requirements and in patiently reviewing version after
6253 version, she both improved this specification and expanded our minds
6254 on document management.
6255
6256 We would also like to thank John Turner for developing the XML DTD.
6257
6258 The authors of RFC 2518 were Yaron Goland, Jim Whitehead, A. Faizi,
6259 Steve Carter, and D. Jensen. Although their names had to be removed
6260 due to IETF author count restrictions, they can take credit for the
6261 majority of the design of WebDAV.
6262
6263 Additional Acknowledgements for This Specification
6264
6265 Significant contributors of text for this specification are listed as
6266 contributors in the section below. We must also gratefully
6267 acknowledge Geoff Clemm, Joel Soderberg, and Dan Brotsky for hashing
6268 out specific text on the list or in meetings. Joe Hildebrand and
6269 Cullen Jennings helped close many issues. Barry Lind described an
6270 additional security consideration and Cullen Jennings provided text
6271
6272
6273
6274Dusseault Standards Track [Page 112]
6275
6276RFC 4918 WebDAV June 2007
6277
6278
6279 for that consideration. Jason Crawford tracked issue status for this
6280 document for a period of years, followed by Elias Sinderson.
6281
628223. Contributors to This Specification
6283
6284 Julian Reschke
6285 <green/>bytes GmbH
6286 Hafenweg 16, 48155 Muenster, Germany
6287 EMail: julian.reschke@greenbytes.de
6288
6289
6290 Elias Sinderson
6291 University of California, Santa Cruz
6292 1156 High Street, Santa Cruz, CA 95064
6293 EMail: elias@cse.ucsc.edu
6294
6295
6296 Jim Whitehead
6297 University of California, Santa Cruz
6298 1156 High Street, Santa Cruz, CA 95064
6299 EMail: ejw@soe.ucsc.edu
6300
630124. Authors of RFC 2518
6302
6303 Y. Y. Goland
6304 Microsoft Corporation
6305 One Microsoft Way
6306 Redmond, WA 98052-6399
6307 EMail: yarong@microsoft.com
6308
6309
6310 E. J. Whitehead, Jr.
6311 Dept. Of Information and Computer Science
6312 University of California, Irvine
6313 Irvine, CA 92697-3425
6314 EMail: ejw@ics.uci.edu
6315
6316
6317 A. Faizi
6318 Netscape
6319 685 East Middlefield Road
6320 Mountain View, CA 94043
6321 EMail: asad@netscape.com
6322
6323
6324
6325
6326
6327
6328
6329
6330Dusseault Standards Track [Page 113]
6331
6332RFC 4918 WebDAV June 2007
6333
6334
6335 S. R. Carter
6336 Novell
6337 1555 N. Technology Way
6338 M/S ORM F111
6339 Orem, UT 84097-2399
6340 EMail: srcarter@novell.com
6341
6342
6343 D. Jensen
6344 Novell
6345 1555 N. Technology Way
6346 M/S ORM F111
6347 Orem, UT 84097-2399
6348 EMail: dcjensen@novell.com
6349
635025. References
6351
635225.1. Normative References
6353
6354 [REC-XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler,
6355 E., and F. Yergeau, "Extensible Markup Language
6356 (XML) 1.0 (Fourth Edition)", W3C REC-xml-20060816,
6357 August 2006,
6358 <http://www.w3.org/TR/2006/REC-xml-20060816/>.
6359
6360 [REC-XML-INFOSET] Cowan, J. and R. Tobin, "XML Information Set
6361 (Second Edition)", W3C REC-xml-infoset-20040204,
6362 February 2004, <http://www.w3.org/TR/2004/
6363 REC-xml-infoset-20040204/>.
6364
6365 [REC-XML-NAMES] Bray, T., Hollander, D., Layman, A., and R. Tobin,
6366 "Namespaces in XML 1.0 (Second Edition)", W3C REC-
6367 xml-names-20060816, August 2006, <http://
6368 www.w3.org/TR/2006/REC-xml-names-20060816/>.
6369
6370 [RFC2119] Bradner, S., "Key words for use in RFCs to
6371 Indicate Requirement Levels", BCP 14, RFC 2119,
6372 March 1997.
6373
6374 [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and
6375 Languages", BCP 18, RFC 2277, January 1998.
6376
6377 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
6378 Masinter, L., Leach, P., and T. Berners-Lee,
6379 "Hypertext Transfer Protocol -- HTTP/1.1",
6380 RFC 2616, June 1999.
6381
6382
6383
6384
6385
6386Dusseault Standards Track [Page 114]
6387
6388RFC 4918 WebDAV June 2007
6389
6390
6391 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J.,
6392 Lawrence, S., Leach, P., Luotonen, A., and L.
6393 Stewart, "HTTP Authentication: Basic and Digest
6394 Access Authentication", RFC 2617, June 1999.
6395
6396 [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on
6397 the Internet: Timestamps", RFC 3339, July 2002.
6398
6399 [RFC3629] Yergeau, F., "UTF-8, a transformation format of
6400 ISO 10646", STD 63, RFC 3629, November 2003.
6401
6402 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter,
6403 "Uniform Resource Identifier (URI): Generic
6404 Syntax", STD 66, RFC 3986, January 2005.
6405
6406 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A
6407 Universally Unique IDentifier (UUID) URN
6408 Namespace", RFC 4122, July 2005.
6409
641025.2. Informative References
6411
6412 [RFC2291] Slein, J., Vitali, F., Whitehead, E., and D.
6413 Durand, "Requirements for a Distributed Authoring
6414 and Versioning Protocol for the World Wide Web",
6415 RFC 2291, February 1998.
6416
6417 [RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S.,
6418 and D. Jensen, "HTTP Extensions for Distributed
6419 Authoring -- WEBDAV", RFC 2518, February 1999.
6420
6421 [RFC2781] Hoffman, P. and F. Yergeau, "UTF-16, an encoding
6422 of ISO 10646", RFC 2781, February 2000.
6423
6424 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML
6425 Media Types", RFC 3023, January 2001.
6426
6427 [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and
6428 J. Whitehead, "Versioning Extensions to WebDAV
6429 (Web Distributed Authoring and Versioning)",
6430 RFC 3253, March 2002.
6431
6432 [RFC3648] Whitehead, J. and J. Reschke, Ed., "Web
6433 Distributed Authoring and Versioning (WebDAV)
6434 Ordered Collections Protocol", RFC 3648,
6435 December 2003.
6436
6437
6438
6439
6440
6441
6442Dusseault Standards Track [Page 115]
6443
6444RFC 4918 WebDAV June 2007
6445
6446
6447 [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J.
6448 Whitehead, "Web Distributed Authoring and
6449 Versioning (WebDAV) Access Control Protocol",
6450 RFC 3744, May 2004.
6451
6452 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul,
6453 "Registration Procedures for Message Header
6454 Fields", BCP 90, RFC 3864, September 2004.
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498Dusseault Standards Track [Page 116]
6499
6500RFC 4918 WebDAV June 2007
6501
6502
6503Appendix A. Notes on Processing XML Elements
6504
6505A.1. Notes on Empty XML Elements
6506
6507 XML supports two mechanisms for indicating that an XML element does
6508 not have any content. The first is to declare an XML element of the
6509 form <A></A>. The second is to declare an XML element of the form
6510 <A/>. The two XML elements are semantically identical.
6511
6512A.2. Notes on Illegal XML Processing
6513
6514 XML is a flexible data format that makes it easy to submit data that
6515 appears legal but in fact is not. The philosophy of "Be flexible in
6516 what you accept and strict in what you send" still applies, but it
6517 must not be applied inappropriately. XML is extremely flexible in
6518 dealing with issues of whitespace, element ordering, inserting new
6519 elements, etc. This flexibility does not require extension,
6520 especially not in the area of the meaning of elements.
6521
6522 There is no kindness in accepting illegal combinations of XML
6523 elements. At best, it will cause an unwanted result and at worst it
6524 can cause real damage.
6525
6526A.3. Example - XML Syntax Error
6527
6528 The following request body for a PROPFIND method is illegal.
6529
6530 <?xml version="1.0" encoding="utf-8" ?>
6531 <D:propfind xmlns:D="DAV:">
6532 <D:allprop/>
6533 <D:propname/>
6534 </D:propfind>
6535
6536 The definition of the propfind element only allows for the allprop or
6537 the propname element, not both. Thus, the above is an error and must
6538 be responded to with a 400 (Bad Request).
6539
6540 Imagine, however, that a server wanted to be "kind" and decided to
6541 pick the allprop element as the true element and respond to it. A
6542 client running over a bandwidth limited line who intended to execute
6543 a propname would be in for a big surprise if the server treated the
6544 command as an allprop.
6545
6546 Additionally, if a server were lenient and decided to reply to this
6547 request, the results would vary randomly from server to server, with
6548 some servers executing the allprop directive, and others executing
6549 the propname directive. This reduces interoperability rather than
6550 increasing it.
6551
6552
6553
6554Dusseault Standards Track [Page 117]
6555
6556RFC 4918 WebDAV June 2007
6557
6558
6559A.4. Example - Unexpected XML Element
6560
6561 The previous example was illegal because it contained two elements
6562 that were explicitly banned from appearing together in the propfind
6563 element. However, XML is an extensible language, so one can imagine
6564 new elements being defined for use with propfind. Below is the
6565 request body of a PROPFIND and, like the previous example, must be
6566 rejected with a 400 (Bad Request) by a server that does not
6567 understand the expired-props element.
6568
6569 <?xml version="1.0" encoding="utf-8" ?>
6570 <D:propfind xmlns:D="DAV:"
6571 xmlns:E="http://www.example.com/standards/props/">
6572 <E:expired-props/>
6573 </D:propfind>
6574
6575 To understand why a 400 (Bad Request) is returned, let us look at the
6576 request body as the server unfamiliar with expired-props sees it.
6577
6578 <?xml version="1.0" encoding="utf-8" ?>
6579 <D:propfind xmlns:D="DAV:"
6580 xmlns:E="http://www.example.com/standards/props/">
6581 </D:propfind>
6582
6583 As the server does not understand the 'expired-props' element,
6584 according to the WebDAV-specific XML processing rules specified in
6585 Section 17, it must process the request as if the element were not
6586 there. Thus, the server sees an empty propfind, which by the
6587 definition of the propfind element is illegal.
6588
6589 Please note that had the extension been additive, it would not
6590 necessarily have resulted in a 400 (Bad Request). For example,
6591 imagine the following request body for a PROPFIND:
6592
6593
6594 <?xml version="1.0" encoding="utf-8" ?>
6595 <D:propfind xmlns:D="DAV:"
6596 xmlns:E="http://www.example.com/standards/props/">
6597 <D:propname/>
6598 <E:leave-out>*boss*</E:leave-out>
6599 </D:propfind>
6600
6601 The previous example contains the fictitious element leave-out. Its
6602 purpose is to prevent the return of any property whose name matches
6603 the submitted pattern. If the previous example were submitted to a
6604 server unfamiliar with 'leave-out', the only result would be that the
6605 'leave-out' element would be ignored and a propname would be
6606 executed.
6607
6608
6609
6610Dusseault Standards Track [Page 118]
6611
6612RFC 4918 WebDAV June 2007
6613
6614
6615Appendix B. Notes on HTTP Client Compatibility
6616
6617 WebDAV was designed to be, and has been found to be, backward-
6618 compatible with HTTP 1.1. The PUT and DELETE methods are defined in
6619 HTTP and thus may be used by HTTP clients as well as WebDAV-aware
6620 clients, but the responses to PUT and DELETE have been extended in
6621 this specification in ways that only a WebDAV client would be
6622 entirely prepared for. Some theoretical concerns were raised about
6623 whether those responses would cause interoperability problems with
6624 HTTP-only clients, and this section addresses those concerns.
6625
6626 Since any HTTP client ought to handle unrecognized 400-level and 500-
6627 level status codes as errors, the following new status codes should
6628 not present any issues: 422, 423, and 507 (424 is also a new status
6629 code but it appears only in the body of a Multistatus response.) So,
6630 for example, if an HTTP client attempted to PUT or DELETE a locked
6631 resource, the 423 Locked response ought to result in a generic error
6632 presented to the user.
6633
6634 The 207 Multistatus response is interesting because an HTTP client
6635 issuing a DELETE request to a collection might interpret a 207
6636 response as a success, even though it does not realize the resource
6637 is a collection and cannot understand that the DELETE operation might
6638 have been a complete or partial failure. That interpretation isn't
6639 entirely justified, because a 200-level response indicates that the
6640 server "received, understood, and accepted" the request, not that the
6641 request resulted in complete success.
6642
6643 One option is that a server could treat a DELETE of a collection as
6644 an atomic operation, and use either 204 No Content in case of
6645 success, or some appropriate error response (400 or 500 level) for an
6646 error. This approach would indeed maximize backward compatibility.
6647 However, since interoperability tests and working group discussions
6648 have not turned up any instances of HTTP clients issuing a DELETE
6649 request against a WebDAV collection, this concern is more theoretical
6650 than practical. Thus, servers are likely to be completely successful
6651 at interoperating with HTTP clients even if they treat any collection
6652 DELETE request as a WebDAV request and send a 207 Multi-Status
6653 response.
6654
6655 In general, server implementations are encouraged to use the detailed
6656 responses and other mechanisms defined in this document rather than
6657 make changes for theoretical interoperability concerns.
6658
6659
6660
6661
6662
6663
6664
6665
6666Dusseault Standards Track [Page 119]
6667
6668RFC 4918 WebDAV June 2007
6669
6670
6671Appendix C. The 'opaquelocktoken' Scheme and URIs
6672
6673 The 'opaquelocktoken' URI scheme was defined in [RFC2518] (and
6674 registered by IANA) in order to create syntactically correct and
6675 easy-to-generate URIs out of UUIDs, intended to be used as lock
6676 tokens and to be unique across all resources for all time.
6677
6678 An opaquelocktoken URI is constructed by concatenating the
6679 'opaquelocktoken' scheme with a UUID, along with an optional
6680 extension. Servers can create new UUIDs for each new lock token. If
6681 a server wishes to reuse UUIDs, the server MUST add an extension, and
6682 the algorithm generating the extension MUST guarantee that the same
6683 extension will never be used twice with the associated UUID.
6684
6685 OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension]
6686 ; UUID is defined in Section 3 of [RFC4122]. Note that LWS
6687 ; is not allowed between elements of
6688 ; this production.
6689
6690 Extension = path
6691 ; path is defined in Section 3.3 of [RFC3986]
6692
6693
6694Appendix D. Lock-null Resources
6695
6696 The original WebDAV model for locking unmapped URLs created "lock-
6697 null resources". This model was over-complicated and some
6698 interoperability and implementation problems were discovered. The
6699 new WebDAV model for locking unmapped URLs (see Section 7.3) creates
6700 "locked empty resources". Lock-null resources are deprecated. This
6701 section discusses the original model briefly because clients MUST be
6702 able to handle either model.
6703
6704 In the original "lock-null resource" model, which is no longer
6705 recommended for implementation:
6706
6707 o A lock-null resource sometimes appeared as "Not Found". The
6708 server responds with a 404 or 405 to any method except for PUT,
6709 MKCOL, OPTIONS, PROPFIND, LOCK, UNLOCK.
6710
6711 o A lock-null resource does however show up as a member of its
6712 parent collection.
6713
6714 o The server removes the lock-null resource entirely (its URI
6715 becomes unmapped) if its lock goes away before it is converted to
6716 a regular resource. Recall that locks go away not only when they
6717 expire or are unlocked, but are also removed if a resource is
6718 renamed or moved, or if any parent collection is renamed or moved.
6719
6720
6721
6722Dusseault Standards Track [Page 120]
6723
6724RFC 4918 WebDAV June 2007
6725
6726
6727 o The server converts the lock-null resource into a regular resource
6728 if a PUT request to the URL is successful.
6729
6730 o The server converts the lock-null resource into a collection if a
6731 MKCOL request to the URL is successful (though interoperability
6732 experience showed that not all servers followed this requirement).
6733
6734 o Property values were defined for DAV:lockdiscovery and DAV:
6735 supportedlock properties but not necessarily for other properties
6736 like DAV:getcontenttype.
6737
6738 Clients can easily interoperate both with servers that support the
6739 old model "lock-null resources" and the recommended model of "locked
6740 empty resources" by only attempting PUT after a LOCK to an unmapped
6741 URL, not MKCOL or GET.
6742
6743D.1. Guidance for Clients Using LOCK to Create Resources
6744
6745 A WebDAV client implemented to this specification might find servers
6746 that create lock-null resources (implemented before this
6747 specification using [RFC2518]) as well as servers that create locked
6748 empty resources. The response to the LOCK request will not indicate
6749 what kind of resource was created. There are a few techniques that
6750 help the client deal with either type.
6751
6752 If the client wishes to avoid accidentally creating either lock-
6753 null or empty locked resources, an "If-Match: *" header can be
6754 included with LOCK requests to prevent the server from creating a
6755 new resource.
6756
6757 If a LOCK request creates a resource and the client subsequently
6758 wants to overwrite that resource using a COPY or MOVE request, the
6759 client should include an "Overwrite: T" header.
6760
6761 If a LOCK request creates a resource and the client then decides
6762 to get rid of that resource, a DELETE request is supposed to fail
6763 on a lock-null resource and UNLOCK should be used instead. But
6764 with a locked empty resource, UNLOCK doesn't make the resource
6765 disappear. Therefore, the client might have to try both requests
6766 and ignore an error in one of the two requests.
6767
6768Appendix E. Guidance for Clients Desiring to Authenticate
6769
6770 Many WebDAV clients that have already been implemented have account
6771 settings (similar to the way email clients store IMAP account
6772 settings). Thus, the WebDAV client would be able to authenticate
6773 with its first couple requests to the server, provided it had a way
6774 to get the authentication challenge from the server with realm name,
6775
6776
6777
6778Dusseault Standards Track [Page 121]
6779
6780RFC 4918 WebDAV June 2007
6781
6782
6783 nonce, and other challenge information. Note that the results of
6784 some requests might vary according to whether or not the client is
6785 authenticated -- a PROPFIND might return more visible resources if
6786 the client is authenticated, yet not fail if the client is anonymous.
6787
6788 There are a number of ways the client might be able to trigger the
6789 server to provide an authentication challenge. This appendix
6790 describes a couple approaches that seem particularly likely to work.
6791
6792 The first approach is to perform a request that ought to require
6793 authentication. However, it's possible that a server might handle
6794 any request even without authentication, so to be entirely safe, the
6795 client could add a conditional header to ensure that even if the
6796 request passes permissions checks, it's not actually handled by the
6797 server. An example of following this approach would be to use a PUT
6798 request with an "If-Match" header with a made-up ETag value. This
6799 approach might fail to result in an authentication challenge if the
6800 server does not test authorization before testing conditionals as is
6801 required (see Section 8.5), or if the server does not need to test
6802 authorization.
6803
6804 Example - forcing auth challenge with write request
6805
6806 >>Request
6807
6808 PUT /forceauth.txt HTTP/1.1
6809 Host: www.example.com
6810 If-Match: "xxx"
6811 Content-Type: text/plain
6812 Content-Length: 0
6813
6814
6815 The second approach is to use an Authorization header (defined in
6816 [RFC2617]), which is likely to be rejected by the server but which
6817 will then prompt a proper authentication challenge. For example, the
6818 client could start with a PROPFIND request containing an
6819 Authorization header containing a made-up Basic userid:password
6820 string or with actual plausible credentials. This approach relies on
6821 the server responding with a "401 Unauthorized" along with a
6822 challenge if it receives an Authorization header with an unrecognized
6823 username, invalid password, or if it doesn't even handle Basic
6824 authentication. This seems likely to work because of the
6825 requirements of RFC 2617:
6826
6827
6828
6829
6830
6831
6832
6833
6834Dusseault Standards Track [Page 122]
6835
6836RFC 4918 WebDAV June 2007
6837
6838
6839 "If the origin server does not wish to accept the credentials sent
6840 with a request, it SHOULD return a 401 (Unauthorized) response. The
6841 response MUST include a WWW-Authenticate header field containing at
6842 least one (possibly new) challenge applicable to the requested
6843 resource."
6844
6845 There's a slight problem with implementing that recommendation in
6846 some cases, because some servers do not even have challenge
6847 information for certain resources. Thus, when there's no way to
6848 authenticate to a resource or the resource is entirely publicly
6849 available over all accepted methods, the server MAY ignore the
6850 Authorization header, and the client will presumably try again later.
6851
6852 Example - forcing auth challenge with Authorization header
6853
6854 >>Request
6855
6856 PROPFIND /docs/ HTTP/1.1
6857 Host: www.example.com
6858 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
6859 Content-type: application/xml; charset="utf-8"
6860 Content-Length: xxxx
6861
6862 [body omitted]
6863
6864
6865Appendix F. Summary of Changes from RFC 2518
6866
6867 This section lists major changes between this document and RFC 2518,
6868 starting with those that are likely to result in implementation
6869 changes. Servers will advertise support for all changes in this
6870 specification by returning the compliance class "3" in the DAV
6871 response header (see Sections 10.1 and 18.3).
6872
6873F.1. Changes for Both Client and Server Implementations
6874
6875 Collections and Namespace Operations
6876
6877 o The semantics of PROPFIND 'allprop' (Section 9.1) have been
6878 relaxed so that servers return results including, at a minimum,
6879 the live properties defined in this specification, but not
6880 necessarily return other live properties. The 'allprop' directive
6881 therefore means something more like "return all properties that
6882 are supposed to be returned when 'allprop' is requested" -- a set
6883 of properties that may include custom properties and properties
6884 defined in other specifications if those other specifications so
6885 require. Related to this, 'allprop' requests can now be extended
6886 with the 'include' syntax to include specific named properties,
6887
6888
6889
6890Dusseault Standards Track [Page 123]
6891
6892RFC 4918 WebDAV June 2007
6893
6894
6895 thereby avoiding additional requests due to changed 'allprop'
6896 semantics.
6897
6898 o Servers are now allowed to reject PROPFIND requests with Depth:
6899 Infinity. Clients that used this will need to be able to do a
6900 series of Depth:1 requests instead.
6901
6902 o Multi-Status response bodies now can transport the value of HTTP's
6903 Location response header in the new 'location' element. Clients
6904 may use this to avoid additional roundtrips to the server when
6905 there is a 'response' element with a 3xx status (see
6906 Section 14.24).
6907
6908 o The definition of COPY has been relaxed so that it doesn't require
6909 servers to first delete the target resources anymore (this was a
6910 known incompatibility with [RFC3253]). See Section 9.8.
6911
6912 Headers and Marshalling
6913
6914 o The Destination and If request headers now allow absolute paths in
6915 addition to full URIs (see Section 8.3). This may be useful for
6916 clients operating through a reverse proxy that does rewrite the
6917 Host request header, but not WebDAV-specific headers.
6918
6919 o This specification adopts the error marshalling extensions and the
6920 "precondition/postcondition" terminology defined in [RFC3253] (see
6921 Section 16). Related to that, it adds the "error" XML element
6922 inside multistatus response bodies (see Section 14.5, however note
6923 that it uses a format different from the one recommended in RFC
6924 3253).
6925
6926 o Senders and recipients are now required to support the UTF-16
6927 character encoding in XML message bodies (see Section 19).
6928
6929 o Clients are now required to send the Depth header on PROPFIND
6930 requests, although servers are still encouraged to support clients
6931 that don't.
6932
6933 Locking
6934
6935 o RFC 2518's concept of "lock-null resources" (LNRs) has been
6936 replaced by a simplified approach, the "locked empty resources"
6937 (see Section 7.3). There are some aspects of lock-null resources
6938 clients cannot rely on anymore, namely, the ability to use them to
6939 create a locked collection or the fact that they disappear upon
6940 UNLOCK when no PUT or MKCOL request was issued. Note that servers
6941 are still allowed to implement LNRs as per RFC 2518.
6942
6943
6944
6945
6946Dusseault Standards Track [Page 124]
6947
6948RFC 4918 WebDAV June 2007
6949
6950
6951 o There is no implicit refresh of locks anymore. Locks are only
6952 refreshed upon explicit request (see Section 9.10.2).
6953
6954 o Clarified that the DAV:owner value supplied in the LOCK request
6955 must be preserved by the server just like a dead property
6956 (Section 14.17). Also added the DAV:lockroot element
6957 (Section 14.12), which allows clients to discover the root of
6958 lock.
6959
6960F.2. Changes for Server Implementations
6961
6962 Collections and Namespace Operations
6963
6964 o Due to interoperability problems, allowable formats for contents
6965 of 'href' elements in multistatus responses have been limited (see
6966 Section 8.3).
6967
6968 o Due to lack of implementation, support for the 'propertybehavior'
6969 request body for COPY and MOVE has been removed. Instead,
6970 requirements for property preservation have been clarified (see
6971 Sections 9.8 and 9.9).
6972
6973 Properties
6974
6975 o Strengthened server requirements for storage of property values,
6976 in particular persistence of language information (xml:lang),
6977 whitespace, and XML namespace information (see Section 4.3).
6978
6979 o Clarified requirements on which properties should be writable by
6980 the client; in particular, setting "DAV:displayname" should be
6981 supported by servers (see Section 15).
6982
6983 o Only 'rfc1123-date' productions are legal as values for DAV:
6984 getlastmodified (see Section 15.7).
6985
6986 Headers and Marshalling
6987
6988 o Servers are now required to do authorization checks before
6989 processing conditional headers (see Section 8.5).
6990
6991 Locking
6992
6993 o Strengthened requirement to check identity of lock creator when
6994 accessing locked resources (see Section 6.4). Clients should be
6995 aware that lock tokens returned to other principals can only be
6996 used to break a lock, if at all.
6997
6998
6999
7000
7001
7002Dusseault Standards Track [Page 125]
7003
7004RFC 4918 WebDAV June 2007
7005
7006
7007 o Section 8.10.4 of [RFC2518] incorrectly required servers to return
7008 a 409 status where a 207 status was really appropriate. This has
7009 been corrected (Section 9.10).
7010
7011F.3. Other Changes
7012
7013 The definition of collection state has been fixed so it doesn't vary
7014 anymore depending on the Request-URI (see Section 5.2).
7015
7016 The DAV:source property introduced in Section 4.6 of [RFC2518] was
7017 removed due to lack of implementation experience.
7018
7019 The DAV header now allows non-IETF extensions through URIs in
7020 addition to compliance class tokens. It also can now be used in
7021 requests, although this specification does not define any associated
7022 semantics for the compliance classes defined in here (see
7023 Section 10.1).
7024
7025 In RFC 2518, the definition of the Depth header (Section 9.2)
7026 required that, by default, request headers would be applied to each
7027 resource in scope. Based on implementation experience, the default
7028 has now been reversed (see Section 10.2).
7029
7030 The definitions of HTTP status code 102 ([RFC2518], Section 10.1) and
7031 the Status-URI response header (Section 9.7) have been removed due to
7032 lack of implementation.
7033
7034 The TimeType format used in the Timeout request header and the
7035 "timeout" XML element used to be extensible. Now, only the two
7036 formats defined by this specification are allowed (see Section 10.7).
7037
7038Author's Address
7039
7040 Lisa Dusseault (editor)
7041 CommerceNet
7042 2064 Edgewood Dr.
7043 Palo Alto, CA 94303
7044 US
7045
7046 EMail: ldusseault@commerce.net
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058Dusseault Standards Track [Page 126]
7059
7060RFC 4918 WebDAV June 2007
7061
7062
7063Full Copyright Statement
7064
7065 Copyright (C) The IETF Trust (2007).
7066
7067 This document is subject to the rights, licenses and restrictions
7068 contained in BCP 78, and except as set forth therein, the authors
7069 retain all their rights.
7070
7071 This document and the information contained herein are provided on an
7072 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
7073 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
7074 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
7075 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
7076 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
7077 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
7078
7079Intellectual Property
7080
7081 The IETF takes no position regarding the validity or scope of any
7082 Intellectual Property Rights or other rights that might be claimed to
7083 pertain to the implementation or use of the technology described in
7084 this document or the extent to which any license under such rights
7085 might or might not be available; nor does it represent that it has
7086 made any independent effort to identify any such rights. Information
7087 on the procedures with respect to rights in RFC documents can be
7088 found in BCP 78 and BCP 79.
7089
7090 Copies of IPR disclosures made to the IETF Secretariat and any
7091 assurances of licenses to be made available, or the result of an
7092 attempt made to obtain a general license or permission for the use of
7093 such proprietary rights by implementers or users of this
7094 specification can be obtained from the IETF on-line IPR repository at
7095 http://www.ietf.org/ipr.
7096
7097 The IETF invites any interested party to bring to its attention any
7098 copyrights, patents or patent applications, or other proprietary
7099 rights that may cover technology that may be required to implement
7100 this standard. Please address the information to the IETF at
7101 ietf-ipr@ietf.org.
7102
7103Acknowledgement
7104
7105 Funding for the RFC Editor function is currently provided by the
7106 Internet Society.
7107
7108
7109
7110
7111
7112
7113
7114Dusseault Standards Track [Page 127]
7115
7116