idnits 2.17.1 draft-ietf-webdav-rfc2518bis-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 15. -- Found old boilerplate from RFC 3978, Section 5.5 on line 5620. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 5597. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 5604. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 5610. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 4 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The draft header indicates that this document obsoletes RFC2518, but the abstract doesn't seem to directly say this. It does mention RFC2518 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 537 has weird spacing: '... 457 The value of the property appears inside the property name element. 458 The value may be any kind of well-formed XML content, including both 459 text-only and mixed content. Servers MUST preserve the following XML 460 Information Items (using the terminology from [W3C.REC-xml-infoset- 461 20040204]) in storage and transmission of dead properties: 463 For the property name Element Information Item itself: 465 [namespace name] 467 [local name] 469 [attributes] named "xml:lang" or any such attribute in scope 471 [children] of type element or character 473 On all Element Information Items in the property value: 475 [namespace name] 477 [local name] 479 [attributes] 481 [children] of type element or character 483 On Attribute Information Items in the property value: 485 [namespace name] 487 [local name] 489 [normalized value] 491 On Character Information Items in the property value: 493 [character code] 495 Since prefixes are used in some XML vocabularies (XPath and XML 496 Schema, for example), servers SHOULD preserve, for any Information 497 Item in the value: 499 [prefix] 501 XML Infoset attributes not listed above MAY be preserved by the 502 server, but clients MUST NOT rely on them being preserved. The above 503 rules would also apply by default to live properties, unless defined 504 otherwise. 506 Servers MUST ignore the XML attribute xml:space if present and never 507 use it to change white space handling. White space in property 508 values is significant. 510 4.3.1. Example - Property with Mixed Content 512 Consider a dead property 'author' created by the client as follows: 514 515 516 Jane Doe 517 518 mailto:jane.doe@example.com 520 http://www.example.com 522 523 Jane has been working way too long on the 524 long-awaited revision of ]]>. 525 526 527 529 When this property is requested, a server might return: 531 536 Jane Doe 537 mailto:jane.doe@example.com 539 http://www.example.com 541 542 Jane has been working way too long on the 543 long-awaited revision of <RFC2518>. 544 545 546 548 Note in this example: 550 o The [prefix] for the property name itself was not preserved, being 551 non-significant, all other [prefix] values have been preserved, 553 o attribute values have been rewritten with double quotes instead of 554 single quotes (quoting style is not significant), and attribute 555 order has not been preserved, 557 o the xml:lang attribute has been returned on the property name 558 element itself (it was in scope when the property was set, but the 559 exact position in the response is not considered significant as 560 long as it is in scope), 562 o whitespace between tags has been preserved everywhere (whitespace 563 between attributes not so), 565 o CDATA encapsulation was replaced with character escaping (the 566 reverse would also be legal), 568 o the comment item was stripped (as would have been a processing 569 instruction item). 571 Implementation note: there are cases such as editing scenarios where 572 clients may require that XML content is preserved character-by- 573 character (such as attribute ordering or quoting style). In this 574 case, clients should consider using a text-only property value by 575 escaping all characters that have a special meaning in XML parsing. 577 4.4. Property Names 579 A property name is a universally unique identifier that is associated 580 with a schema that provides information about the syntax and 581 semantics of the property. 583 Because a property's name is universally unique, clients can depend 584 upon consistent behavior for a particular property across multiple 585 resources, on the same and across different servers, so long as that 586 property is "live" on the resources in question, and the 587 implementation of the live property is faithful to its definition. 589 The XML namespace mechanism, which is based on URIs ([RFC3986]), is 590 used to name properties because it prevents namespace collisions and 591 provides for varying degrees of administrative control. 593 The property namespace is flat; that is, no hierarchy of properties 594 is explicitly recognized. Thus, if a property A and a property A/B 595 exist on a resource, there is no recognition of any relationship 596 between the two properties. It is expected that a separate 597 specification will eventually be produced which will address issues 598 relating to hierarchical properties. 600 Finally, it is not possible to define the same property twice on a 601 single resource, as this would cause a collision in the resource's 602 property namespace. 604 4.5. Source Resources and Output Resources 606 Some HTTP resources are dynamically generated by the server. For 607 these resources, there presumably exists source code somewhere 608 governing how that resource is generated. The relationship of source 609 files to output HTTP resources may be one to one, one to many, many 610 to one or many to many. There is no mechanism in HTTP to determine 611 whether a resource is even dynamic, let alone where its source files 612 exist or how to author them. Although this problem would usefully be 613 solved, interoperable WebDAV implementations have been widely 614 deployed without actually solving this problem, by dealing only with 615 static resources. Thus, the source vs. output problem is not solved 616 in this specification and has been deferred to a separate document. 618 5. Collections of Web Resources 620 This section provides a description of a new type of Web resource, 621 the collection, and discusses its interactions with the HTTP URL 622 namespace. The purpose of a collection resource is to model 623 collection-like objects (e.g., file system directories) within a 624 server's namespace. 626 All DAV compliant resources MUST support the HTTP URL namespace model 627 specified herein. 629 5.1. HTTP URL Namespace Model 631 The HTTP URL namespace is a hierarchical namespace where the 632 hierarchy is delimited with the "/" character. 634 An HTTP URL namespace is said to be consistent if it meets the 635 following conditions: for every URL in the HTTP hierarchy there 636 exists a collection that contains that URL as an internal member. 637 The root, or top-level collection of the namespace under 638 consideration is exempt from the previous rule. The top-level 639 collection of the namespace under consideration is not necessarily 640 the collection identified by the absolute path '/', it may be 641 identified by one or more path segments (e.g. /servlets/webdav/...) 643 Neither HTTP/1.1 nor WebDAV require that the entire HTTP URL 644 namespace be consistent -- a WebDAV-compatible resource may not have 645 a parent collection. However, certain WebDAV methods are prohibited 646 from producing results that cause namespace inconsistencies. 648 Although implicit in [RFC2616] and [RFC3986], any resource, including 649 collection resources, MAY be identified by more than one URI. For 650 example, a resource could be identified by multiple HTTP URLs. 652 5.2. Collection Resources 654 A collection is a resource whose state consists of at least a list of 655 internal member URLs and a set of properties, but which may have 656 additional state such as entity bodies returned by GET. An internal 657 member URL MUST be immediately relative to a base URL of the 658 collection. That is, the internal member URL is equal to a 659 containing collection's URL plus an additional segment for non- 660 collection resources, or additional segment plus trailing slash "/" 661 for collection resources, where segment is defined in section 3.3 of 662 [RFC3986]. 664 Any given internal member URL MUST only belong to the collection 665 once, i.e., it is illegal to have multiple instances of the same URL 666 in a collection. Properties defined on collections behave exactly as 667 do properties on non-collection resources. 669 For all WebDAV compliant resources A and B, identified by URLs U and 670 V, for which U is immediately relative to V, B MUST be a collection 671 that has U as an internal member URL. So, if the resource with URL 672 http://example.com/bar/blah is WebDAV compliant and if the resource 673 with URL http://example.com/bar/ is WebDAV compliant then the 674 resource with URL http://example.com/bar/ must be a collection and 675 must contain URL http://example.com/bar/blah as an internal member. 677 Collection resources MAY list the URLs of non-WebDAV compliant 678 children in the HTTP URL namespace hierarchy as internal members but 679 are not required to do so. For example, if the resource with URL 680 http://example.com/bar/blah is not WebDAV compliant and the URL 681 http://example.com/bar/ identifies a collection then URL 682 http://example.com/bar/blah may or may not be an internal member of 683 the collection with URL http://example.com/bar/. 685 If a WebDAV compliant resource has no WebDAV compliant children in 686 the HTTP URL namespace hierarchy then the WebDAV compliant resource 687 is not required to be a collection. 689 There is a standing convention that when a collection is referred to 690 by its name without a trailing slash, the server MAY handle the 691 request as if the trailing slash were present. In this case it 692 SHOULD return a Content-Location header in the response, pointing to 693 the URL ending with the "/". For example, if a client invokes a 694 method on http://example.com/blah (no trailing slash), the server may 695 respond as if the operation were invoked on http://example.com/blah/ 696 (trailing slash), and should return a Content-Location header with 697 the value http://example.com/blah/. Wherever a server produces a URL 698 referring to a collection, the server SHOULD include the trailing 699 slash. In general clients SHOULD use the trailing slash form of 700 collection names. If clients do not use the trailing slash form the 701 client needs to be prepared to see a redirect response. Clients will 702 find the DAV:resourcetype property more reliable than the URL to find 703 out if a resource is a collection. 705 Clients MUST be able to support the case where WebDAV resources are 706 contained inside non-WebDAV resources. For example, if a OPTIONS 707 response from "http://example.com/servlet/dav/collection" indicates 708 WebDAV support, the client cannot assume that 709 "http://example.com/servlet/dav/" or its parent necessarily are 710 WebDAV collections. 712 6. Locking 714 The ability to lock a resource provides a mechanism for serializing 715 access to that resource. Using a lock, an authoring client can 716 provide a reasonable guarantee that another principal will not modify 717 a resource while it is being edited. In this way, a client can 718 prevent the "lost update" problem. 720 This specification allows locks to vary over two client-specified 721 parameters, the number of principals involved (exclusive vs. shared) 722 and the type of access to be granted. This document defines locking 723 for only one access type, write. However, the syntax is extensible, 724 and permits the eventual specification of locking for other access 725 types. 727 6.1. Exclusive Vs. Shared Locks 729 The most basic form of lock is an exclusive lock. Only one exclusive 730 lock may exist on any resource, whether it is directly or indirectly 731 locked (Section 7.6). Exclusive locks avoid having to merge results, 732 without requiring any coordination other than the methods described 733 in this specification. 735 However, there are times when the goal of a lock is not to exclude 736 others from exercising an access right but rather to provide a 737 mechanism for principals to indicate that they intend to exercise 738 their access rights. Shared locks are provided for this case. A 739 shared lock allows multiple principals to receive a lock. Hence any 740 principal with appropriate access can use the lock. 742 With shared locks there are two trust sets that affect a resource. 743 The first trust set is created by access permissions. Principals who 744 are trusted, for example, may have permission to write to the 745 resource. Among those who have access permission to write to the 746 resource, the set of principals who have taken out a shared lock also 747 must trust each other, creating a (typically) smaller trust set 748 within the access permission write set. 750 Starting with every possible principal on the Internet, in most 751 situations the vast majority of these principals will not have write 752 access to a given resource. Of the small number who do have write 753 access, some principals may decide to guarantee their edits are free 754 from overwrite conflicts by using exclusive write locks. Others may 755 decide they trust their collaborators will not overwrite their work 756 (the potential set of collaborators being the set of principals who 757 have write permission) and use a shared lock, which informs their 758 collaborators that a principal may be working on the resource. 760 The WebDAV extensions to HTTP do not need to provide all of the 761 communications paths necessary for principals to coordinate their 762 activities. When using shared locks, principals may use any out of 763 band communication channel to coordinate their work (e.g., face-to- 764 face interaction, written notes, post-it notes on the screen, 765 telephone conversation, Email, etc.) The intent of a shared lock is 766 to let collaborators know who else may be working on a resource. 768 Shared locks are included because experience from web distributed 769 authoring systems has indicated that exclusive locks are often too 770 rigid. An exclusive lock is used to enforce a particular editing 771 process: take out an exclusive lock, read the resource, perform 772 edits, write the resource, release the lock. This editing process 773 has the problem that locks are not always properly released, for 774 example when a program crashes, or when a lock creator leaves without 775 unlocking a resource. While both timeouts and administrative action 776 can be used to remove an offending lock, neither mechanism may be 777 available when needed; the timeout may be long or the administrator 778 may not be available. 780 6.2. Required Support 782 A WebDAV compliant resource is not required to support locking in any 783 form. If the resource does support locking it may choose to support 784 any combination of exclusive and shared locks for any access types. 786 The reason for this flexibility is that locking policy strikes to the 787 very heart of the resource management and versioning systems employed 788 by various storage repositories. These repositories require control 789 over what sort of locking will be made available. For example, some 790 repositories only support shared write locks while others only 791 provide support for exclusive write locks while yet others use no 792 locking at all. As each system is sufficiently different to merit 793 exclusion of certain locking features, this specification leaves 794 locking as the sole axis of negotiation within WebDAV. 796 6.3. Lock Creator 798 The creator of a lock has special privileges to use the locked 799 resource. The server MUST restrict the usage of a lock token to the 800 creator of the lock, both for shared and exclusive locks. For multi- 801 user shared lock cases, each authenticated principal MUST obtain its 802 own shared lock. 804 The server MAY allow privileged users other than the lock creator to 805 destroy a lock (for example, the resource owner or an administrator) 806 as a special case of lock usage. 808 If an anonymous user requests a lock, the server MAY refuse the 809 request. 811 6.4. Lock Tokens 813 A lock token is a type of state token, represented as a URI, which 814 identifies a particular lock. Each lock has exactly one unique lock 815 token generated by the server. Clients MUST NOT attempt to interpret 816 lock tokens in any way. 818 Lock token URIs MUST be unique across all resources for all time. 819 This uniqueness constraint allows lock tokens to be submitted across 820 resources and servers without fear of confusion. Since lock tokens 821 are unique, a client MAY submit a lock token in an If header on a 822 resource other than the one that returned it. 824 When a LOCK operation creates a new lock, the new lock token is 825 returned in the Lock-Token response header defined in Section 9.5, 826 and also in the body of the response. 828 Submitting a lock token does not confer full privilege to use the 829 lock token or modify the locked resource. Write access and other 830 privileges MUST be enforced through normal privilege or 831 authentication mechanisms, not based on the possible obscurity of 832 lock token values. 834 Servers MAY make lock tokens publicly readable (e.g. in the DAV: 835 lockdiscovery property). One use case for making lock tokens 836 readable is so that a long-lived lock can be removed by the resource 837 owner (the client that obtained the lock might have crashed or 838 disconnected before cleaning up the lock). Except for the case of 839 using UNLOCK under user guidance, a client SHOULD NOT use a lock 840 tokens created by another client instance. 842 This specification encourages servers to create UUIDs for lock 843 tokens, and to use the URI form defined by "A Universally Unique 844 Identifier (UUID) URN Namespace" ([RFC4122]). However servers are 845 free to use any URI (e.g. from another scheme) so long as it meets 846 the uniqueness requirements. For example, a valid lock token might 847 be constructed using the "opaquelocktoken" scheme defined in 848 Appendix C. 850 Example: "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6" 852 6.5. Lock Capability Discovery 854 Since server lock support is optional, a client trying to lock a 855 resource on a server can either try the lock and hope for the best, 856 or perform some form of discovery to determine what lock capabilities 857 the server supports. This is known as lock capability discovery. A 858 client can determine what lock types the server supports by 859 retrieving the DAV:supportedlock property. 861 Any DAV compliant resource that supports the LOCK method MUST support 862 the DAV:supportedlock property. 864 6.6. Active Lock Discovery 866 If another principal locks a resource that a principal wishes to 867 access, it is useful for the second principal to be able to find out 868 who the first principal is. For this purpose the DAV:lockdiscovery 869 property is provided. This property lists all outstanding locks, 870 describes their type, and MAY even provide the lock tokens. 872 Any DAV compliant resource that supports the LOCK method MUST support 873 the DAV:lockdiscovery property. 875 6.7. Locks and Multiple Bindings 877 A resource may be made available through more than one URI. A lock 878 MUST cover the resource as well as the URI to which the LOCK request 879 was addressed. The lock MAY cover other URIs mapped to the same 880 resource as well. 882 7. Write Lock 884 This section describes the semantics specific to the write lock type. 885 The write lock is a specific instance of a lock type, and is the only 886 lock type described in this specification. 888 An exclusive write lock will prevent parallel changes to a resource 889 by any principal other than the write lock holder. In general terms, 890 changes affected by write locks include changes to: 892 o the content of the resource 894 o any dead property of the resource 896 o any live property defined to be lockable (all properties defined 897 in this specification are lockable) 899 o the direct membership of the resource, if it is a collection 901 o the URL/location of a resource 903 The next few sections describe in more specific terms how write locks 904 interact with various operations. 906 7.1. Methods Restricted by Write Locks 908 A server MUST reject any write request that alters a write-locked 909 resource unless a valid lock token is provided. The write operations 910 defined in HTTP and WebDAV are PUT, POST, PROPPATCH, LOCK, UNLOCK, 911 MOVE, COPY (for the destination resource), DELETE, and MKCOL. All 912 other HTTP/WebDAV methods, GET in particular, function independently 913 of the lock. A shared write lock prevents the same operations 914 (except additional requests for shared write locks), however it also 915 allows access by any principal that has a shared write lock on the 916 same resource. 918 Note, however, that as new methods are created it will be necessary 919 to specify how they interact with a write lock. 921 7.2. Write Locks and Lock Tokens 923 A successful request for an exclusive or shared write lock MUST 924 result in the generation of a unique lock token associated with the 925 requesting principal. Thus if five principals have a shared write 926 lock on the same resource there will be five lock tokens, one for 927 each principal. 929 7.3. Write Locks and Properties 931 While those without a write lock may not alter a property on a 932 resource it is still possible for the values of live properties to 933 change, even while locked, due to the requirements of their schemas. 934 Only dead properties and live properties defined to respect locks are 935 guaranteed not to change while write locked. 937 7.4. Avoiding Lost Updates 939 Although the write locks provide some help in preventing lost 940 updates, they cannot guarantee that updates will never be lost. 941 Consider the following scenario: 943 Two clients A and B are interested in editing the resource 944 'index.html'. Client A is an HTTP client rather than a WebDAV 945 client, and so does not know how to perform locking. 947 Client A doesn't lock the document, but does a GET and begins 948 editing. 950 Client B does LOCK, performs a GET and begins editing. 952 Client B finishes editing, performs a PUT, then an UNLOCK. 954 Client A performs a PUT, overwriting and losing all of B's changes. 956 There are several reasons why the WebDAV protocol itself cannot 957 prevent this situation. First, it cannot force all clients to use 958 locking because it must be compatible with HTTP clients that do not 959 comprehend locking. Second, it cannot require servers to support 960 locking because of the variety of repository implementations, some of 961 which rely on reservations and merging rather than on locking. 962 Finally, being stateless, it cannot enforce a sequence of operations 963 like LOCK / GET / PUT / UNLOCK. 965 WebDAV servers that support locking can reduce the likelihood that 966 clients will accidentally overwrite each other's changes by requiring 967 clients to lock resources before modifying them. Such servers would 968 effectively prevent HTTP 1.0 and HTTP 1.1 clients from modifying 969 resources. 971 WebDAV clients can be good citizens by using a lock / retrieve / 972 write /unlock sequence of operations (at least by default) whenever 973 they interact with a WebDAV server that supports locking. 975 HTTP 1.1 clients can be good citizens, avoiding overwriting other 976 clients' changes, by using entity tags in If-Match headers with any 977 requests that would modify resources. 979 Information managers may attempt to prevent overwrites by 980 implementing client-side procedures requiring locking before 981 modifying WebDAV resources. 983 7.5. Write Locks and Unmapped URLs 985 WebDAV provides the ability to lock an unmapped URL in order to 986 reserve the name for use. This is a simple way to avoid the lost- 987 update problem on the creation of a new resource (another way is to 988 use If-None-Match header specified in HTTP 1.1). It has the side 989 benefit of locking the new resource immediately for use of the 990 creator. 992 Note that the lost-update problem is not an issue for collections 993 because MKCOL can only be used to create a collection, not to 994 overwrite an existing collection. When trying to lock a collection 995 upon creation, clients may attempt to increase the likelihood of 996 getting the lock by pipelining the MKCOL and LOCK requests together 997 (but because this doesn't convert two separate operations into one 998 atomic operation there's no guarantee this will work). 1000 A successful lock request to an unmapped URL MUST result in the 1001 creation of an locked resource with empty content. Subsequently, a 1002 successful PUT request (with the correct lock token) provides the 1003 content for the resource, and a server that normally uses the client- 1004 provided content-type MUST also use the content-type and content- 1005 language information from this request. 1007 The original WebDAV model for locking unmapped URLs created "lock- 1008 null resources". This model was over-complicated and some 1009 interoperability and implementation problems were discovered. The 1010 new WebDAV model for locking unmapped URLs creates "locked empty 1011 resources". Servers MUST implement either lock-null resources or 1012 locked empty resources, but servers SHOULD implement locked empty 1013 resources. This section discusses the original model briefly and the 1014 new model more completely, because clients MUST be able to handle 1015 either model. 1017 In the original "lock-null resource" model, which is no longer 1018 recommended for implementation: 1020 o A lock-null resource sometimes appeared as "Not Found". The 1021 server responds with a 404 or 405 to any method except for PUT, 1022 MKCOL, OPTIONS, PROPFIND, LOCK, UNLOCK. 1024 o A lock-null resource does however show up as a member of its 1025 parent collection. 1027 o The server removes the lock-null resource entirely (its URI 1028 becomes unmapped) if its lock goes away before it is converted to 1029 a regular resource. Recall that locks go away not only when they 1030 expire or are unlcoked, but are also removed if a resource is 1031 renamed or moved, or if any parent collection is renamed or moved. 1033 o The server converts the lock-null resource into a regular resource 1034 if a PUT request to the URL is successful. 1036 o The server converts the lock-null resource into a collection if a 1037 MKCOL request to the URL is successful (though interoperability 1038 experience showed that not all servers followed this requirement). 1040 o Property values were defined for DAV:lockdiscovery and DAV: 1041 supportedlock properties but not necessarily for other properties 1042 like DAV:getcontenttype. 1044 In the "locked empty resource" model, which is now the recommended 1045 implementation, a resource created with a LOCK is empty but otherwise 1046 behaves in every way as a normal resource. A locked empty resource: 1048 o Can be read, deleted, moved, copied, and in all ways behave as a 1049 regular resource, not a lock-null resource. 1051 o Appears as a member of its parent collection. 1053 o SHOULD NOT disappear when its lock goes away (clients must 1054 therefore be responsible for cleaning up their own mess, as with 1055 any other operation or any non-empty resource) 1057 o SHOULD default to having no content type. 1059 o MAY NOT have values for properties like DAV:getcontentlanguage 1060 which haven't been specified yet by the client. 1062 o Can be updated (have content added) with a PUT request. 1064 o MUST NOT be converted into a collection. The server MUST fail a 1065 MKCOL request (as it would with a MKCOL request to any existing 1066 non-collection resource). 1068 o MUST have defined values for DAV:lockdiscovery and DAV: 1069 supportedlock properties. 1071 o The response MUST indicate that a resource was created, by use of 1072 the "201 Created" response code (a LOCK request to an existing 1073 resource instead will result in 200 OK). The body must still 1074 include the DAV:lockdiscovery property, as with a LOCK request to 1075 an existing resource. 1077 The client is expected to update the locked empty resource shortly 1078 after locking it, using PUT and possibly PROPPATCH. When the client 1079 uses PUT to overwrite a locked empty resource the client MUST supply 1080 a Content-Type if any is known. 1082 Clients can easily interoperate both with servers that support the 1083 old model "lock-null resources" and the recommended model of "locked 1084 empty resources" by only attempting PUT after a LOCK to an unmapped 1085 URL, not MKCOL or GET. 1087 7.6. Write Locks and Collections 1089 A write lock on a collection, whether created by a "Depth: 0" or 1090 "Depth: infinity" lock request, prevents the addition or removal of 1091 member URLs of the collection by principals other than the lock 1092 creator. 1094 A zero-depth lock on a collection affects changes to the direct 1095 membership of that collection. When a principal issues a write 1096 request to create a new resource in a write locked collection, or 1097 isses a DELETE, MOVE or other request that would remove an existing 1098 internal member URL of a write locked collection or change the 1099 binding name, this request MUST fail if the principal does not 1100 provide the correct lock token for the locked collection. 1102 This means that if a collection is locked (depth 0 or infinity), its 1103 lock-token is required in all these cases: 1105 o DELETE a collection's direct internal member 1107 o MOVE a member out of the collection 1109 o MOVE a member into the collection 1111 o MOVE to rename a member within a collection 1113 o COPY a member into a collection 1115 o PUT or MKCOL request which would create a new member. 1117 The collection's lock token is required in addition to the lock token 1118 on the internal member itself, if it is locked separately. 1120 In addition, a depth-infinity lock affects all write operations to 1121 all descendents of the locked collection. With a depth-infinity 1122 lock, the root of the lock is directly locked, and all its 1123 descendants are indirectly locked. 1125 o Any new resource added as a descendent of a depth-infinity locked 1126 collection becomes indirectly locked. 1128 o Any indirectly locked resource moved out of the locked collection 1129 into an unlocked collection is thereafter unlocked. 1131 o Any indirectly locked resource moved out of a locked source 1132 collection into a depth-infinity locked target collection remains 1133 indirectly locked but is now within the scope of the lock on the 1134 target collection (the target collection's lock token will 1135 thereafter be required to make further changes). 1137 If a depth-infinity write LOCK request is issued to a collection 1138 containing member URLs identifying resources that are currently 1139 locked in a manner which conflicts with the write lock, the request 1140 MUST fail with a 423 (Locked) status code, and the response SHOULD 1141 contain the 'no-conflicting-lock' precondition. 1143 If a lock creator causes the URL of a resource to be added as an 1144 internal member URL of a depth-infinity locked collection then the 1145 new resource MUST be automatically added to the lock. This is the 1146 only mechanism that allows a resource to be added to a write lock. 1147 Thus, for example, if the collection /a/b/ is write locked and the 1148 resource /c is moved to /a/b/c then resource /a/b/c will be added to 1149 the write lock. 1151 7.7. Write Locks and the If Request Header 1153 If a user agent is not required to have knowledge about a lock when 1154 requesting an operation on a locked resource, the following scenario 1155 might occur. Program A, run by User A, takes out a write lock on a 1156 resource. Program B, also run by User A, has no knowledge of the 1157 lock taken out by Program A, yet performs a PUT to the locked 1158 resource. In this scenario, the PUT succeeds because locks are 1159 associated with a principal, not a program, and thus program B, 1160 because it is acting with principal A's credential, is allowed to 1161 perform the PUT. However, had program B known about the lock, it 1162 would not have overwritten the resource, preferring instead to 1163 present a dialog box describing the conflict to the user. Due to 1164 this scenario, a mechanism is needed to prevent different programs 1165 from accidentally ignoring locks taken out by other programs with the 1166 same authorization. 1168 In order to prevent these collisions a lock token MUST be submitted 1169 by an authorized principal for all locked resources that a method may 1170 change or the method MUST fail. A lock token is submitted when it 1171 appears in an If header. For example, if a resource is to be moved 1172 and both the source and destination are locked then two lock tokens 1173 must be submitted in the if header, one for the source and the other 1174 for the destination. 1176 7.7.1. Example - Write Lock and COPY 1178 >>Request 1180 COPY /~fielding/index.html HTTP/1.1 1181 Host: www.ics.uci.edu 1182 Destination: http://www.ics.uci.edu/users/f/fielding/index.html 1183 If: 1184 () 1186 >>Response 1188 HTTP/1.1 204 No Content 1190 In this example, even though both the source and destination are 1191 locked, only one lock token must be submitted, for the lock on the 1192 destination. This is because the source resource is not modified by 1193 a COPY, and hence unaffected by the write lock. In this example, 1194 user agent authentication has previously occurred via a mechanism 1195 outside the scope of the HTTP protocol, in the underlying transport 1196 layer. 1198 7.7.2. Example - Deleting a member of a locked collection 1200 Consider a collection "/locked" exclusively write-locked with Depth: 1201 Infinity, and an attempt to delete an internal member "/locked/ 1202 member": 1204 >>Request 1206 DELETE /locked/member HTTP/1.1 1207 Host: example.com 1209 >>Response 1211 HTTP/1.1 423 Locked 1212 Content-Type: application/xml; charset="utf-8" 1213 Content-Length: xxxx 1215 1216 1217 1218 /locked/ 1219 1220 1222 Thus the client would need to submit the lock token with the request 1223 to make it succeed. To do that, various forms of the If header (see 1224 Section 9.4) could be used. 1226 "No-Tag-List" format: 1228 If: () 1230 "Tagged-List" format, for "http://example.com/locked/": 1232 If: 1233 () 1235 "Tagged-List" format, for "http://example.com/locked/member": 1237 If: 1238 () 1240 Note that for the purpose of submitting the lock token the actual 1241 form doesn't matter; what's relevant is that the lock token appears 1242 in the If header, and that the If header itself evaluates to true. 1244 7.8. Write Locks and COPY/MOVE 1246 A COPY method invocation MUST NOT duplicate any write locks active on 1247 the source. However, as previously noted, if the COPY copies the 1248 resource into a collection that is locked with "Depth: infinity", 1249 then the resource will be added to the lock. 1251 A successful MOVE request on a write locked resource MUST NOT move 1252 the write lock with the resource. However, if there is an existing 1253 lock at the destination, the server MUST add the moved resource to 1254 the destination lock scope. For example, if the MOVE makes the 1255 resource a child of a collection that is locked with "Depth: 1256 infinity", then the resource will be added to that collection's lock. 1258 Additionally, if a resource locked with "Depth: infinity" is moved to 1259 a destination that is within the scope of the same lock (e.g., within 1260 the URL namespace tree covered by the lock), the moved resource will 1261 again be a added to the lock. In both these examples, as specified 1262 in Section 7.7, an If header must be submitted containing a lock 1263 token for both the source and destination. 1265 7.9. Refreshing Write Locks 1267 A client MUST NOT submit the same write lock request twice. Note 1268 that a client is always aware it is resubmitting the same lock 1269 request because it must include the lock token in the If header in 1270 order to make the request for a resource that is already locked. 1272 However, a client may submit a LOCK method with an If header but 1273 without a body. This form of LOCK MUST only be used to "refresh" a 1274 lock. Meaning, at minimum, that any timers associated with the lock 1275 MUST be re-set. 1277 A server may return a Timeout header with a lock refresh that is 1278 different than the Timeout header returned when the lock was 1279 originally requested. Additionally clients may submit Timeout 1280 headers of arbitrary value with their lock refresh requests. 1281 Servers, as always, may ignore Timeout headers submitted by the 1282 client. Note that timeout is measured in seconds remaining until 1283 expiration. 1285 If an error is received in response to a refresh LOCK request the 1286 client MUST NOT assume that the lock was refreshed. 1288 8. HTTP Methods for Distributed Authoring 1290 8.1. General Request and Response Handling 1292 8.1.1. Use of XML 1294 In HTTP/1.1, method parameter information was exclusively encoded in 1295 HTTP headers. Unlike HTTP/1.1, WebDAV encodes method parameter 1296 information either in an [XML] request entity body, or in an HTTP 1297 header. The use of XML to encode method parameters was motivated by 1298 the ability to add extra XML elements to existing structures, 1299 providing extensibility; and by XML's ability to encode information 1300 in ISO 10646 character sets, providing internationalization support. 1302 In addition to encoding method parameters, XML is used in WebDAV to 1303 encode the responses from methods, providing the extensibility and 1304 internationalization advantages of XML for method output, as well as 1305 input. 1307 All DAV compliant clients and resources MUST use XML parsers that are 1308 compliant with [XML] and XML Namespaces [W3C.REC-xml-names-19990114]. 1309 All XML used in either requests or responses MUST be, at minimum, 1310 well formed and use namespaces correctly. If a server receives XML 1311 that is not well-formed then the server MUST reject the entire 1312 request with a 400 (Bad Request). If a client receives XML that is 1313 not well-formed in a response then the client MUST NOT assume 1314 anything about the outcome of the executed method and SHOULD treat 1315 the server as malfunctioning. 1317 Note that processing XML submitted by an untrusted source may cause 1318 risks connected to privacy, security, and service quality (see 1319 Section 19). Servers MAY reject questionable requests (even though 1320 they consist of well-formed XML), for instance with a 400 (Bad 1321 Request) status code and an optional response body explaining the 1322 problem. 1324 8.1.2. Required Bodies in Requests 1326 Some of these new methods do not define bodies. Servers MUST examine 1327 all requests for a body, even when a body was not expected. In cases 1328 where a request body is present but would be ignored by a server, the 1329 server MUST reject the request with 415 (Unsupported Media Type). 1330 This informs the client (which may have been attempting to use an 1331 extension) that the body could not be processed as they intended. 1333 8.1.3. HTTP Headers for use in WebDAV 1335 HTTP defines many headers that can be used in WebDAV requests and 1336 responses. Not all of these are appropriate in all situations and 1337 some interactions may be undefined. Note that HTTP 1.1 requires the 1338 Date header in all responses if possible (see section 14.18, 1339 [RFC2616]). 1341 The server MUST do authorization checks before checking any HTTP 1342 conditional header. 1344 8.1.4. ETag 1346 HTTP 1.1 recommends the use of the ETag header in responses to GET 1347 and PUT requests. Correct use of ETags is even more important in a 1348 distributed authoring environment, because ETags are necessary along 1349 with locks to avoid the lost-update problem. A client might fail to 1350 renew a lock, for example when the lock times out and the client is 1351 accidentally offline or in the middle of a long upload. When a 1352 client fails to renew the lock, it's quite possible the resource can 1353 still be relocked and the user can go on editing, as long as no 1354 changes were made in the meantime. ETags are required for the client 1355 to be able to distinguish this case. Otherwise, the client is forced 1356 to ask the user whether to overwrite the resource on the server 1357 without even being able to tell the user whether it has changed. 1358 Timestamps do not solve this problem nearly as well as ETags. 1360 WebDAV servers SHOULD support strong ETags for all resources that may 1361 be PUT. If ETags are supported for a resource, the server MUST 1362 return the ETag header in all PUT and GET responses to that resource. 1364 Because clients may be forced to prompt users or throw away changed 1365 content if the ETag changes, a WebDAV server SHOULD NOT change the 1366 ETag (or the Last-Modified time) for a resource that has an unchanged 1367 body and location. The ETag represents the state of the body or 1368 contents of the resource. There is no similar way to tell if 1369 properties have changed. 1371 8.1.5. Including error response bodies 1373 HTTP and WebDAV did not use the bodies of most error responses for 1374 machine-parsable information until DeltaV introduced a mechanism to 1375 include more specific information in the body of an error response 1376 (section 1.6 of [RFC3253]). The error body mechanism is appropriate 1377 to use with any error response that may take a body but does not 1378 already have a body defined. The mechanism is particularly 1379 appropriate when a status code can mean many things (for example, 400 1380 Bad Request can mean required headers are missing, headers are 1381 incorrectly formatted, or much more). This error body mechanism is 1382 covered in Section 15 1384 8.1.6. Impact of Namespace Operations on Cache Validators 1386 Note that the HTTP response headers "Etag" and "Last-Modified" (see 1387 [RFC2616], Sections 14.19 and 14.29) are defined per URL (not per 1388 resource), and are used by clients for caching. Therefore servers 1389 must ensure that executing any operation that affects the URL 1390 namespace (such as COPY, MOVE, DELETE, PUT or MKCOL) does preserve 1391 their semantics, in particular: 1393 For any given URL, the "Last-Modified" value MUST increment every 1394 time the representation returned upon GET changes (within the 1395 limits of timestamp resolution). 1397 For any given URL, an "ETag" value MUST NOT be re-used for 1398 different representations returned by GET. 1400 In practice this means that servers 1402 might have to increment "Last-Modified" timestamps for every 1403 resource inside the destination namespace of a namespace operation 1404 unless it can do so more selectively, and 1406 similarily, might have to re-assign "ETag" values for these 1407 resources (unless the server allocates entity tags in a way so 1408 that they are unique across the whole URL namespace managed by the 1409 server). 1411 Note that these considerations also apply to specific use cases, such 1412 as using PUT to create a new resource at a URL that has been mapped 1413 before, but has been deleted since then. 1415 Finally, WebDAV properties (such as DAV:getetag and DAV: 1416 getlastmodified) that inherit their semantics from HTTP headers must 1417 behave accordingly. 1419 8.2. PROPFIND Method 1421 The PROPFIND method retrieves properties defined on the resource 1422 identified by the Request-URI, if the resource does not have any 1423 internal members, or on the resource identified by the Request-URI 1424 and potentially its member resources, if the resource is a collection 1425 that has internal member URLs. All DAV compliant resources MUST 1426 support the PROPFIND method and the propfind XML element 1427 (Section 13.19) along with all XML elements defined for use with that 1428 element. 1430 A client may submit a Depth header with a value of "0", "1", or 1431 "infinity" with a PROPFIND on a collection resource. Servers MUST 1432 support "0" and "1" depth requests on WebDAV-compliant resources and 1433 SHOULD support "infinity" requests in the absence of serious 1434 performance issues. By default, the PROPFIND method without a Depth 1435 header MUST act as if a "Depth: infinity" header was included. 1437 A client may submit a 'propfind' XML element in the body of the 1438 request method describing what information is being requested. It is 1439 possible to: 1441 o Request particular property values, by naming the properties 1442 desired within the 'prop' element (the ordering of properties in 1443 here MAY be ignored by server), 1445 o Request property values for those properties defined in this 1446 specification plus dead properties, by using the 'allprop' element 1447 (the 'include' element can be used with 'allprop' to instruct the 1448 server to also include additional live properties that may not 1449 have been returned otherwise), 1451 o Request a list of names of all the properties defined on the 1452 resource, by using the 'propname' element. 1454 A client may choose not to submit a request body. An empty PROPFIND 1455 request body MUST be treated as if it were an 'allprop' request. 1457 Note that 'allprop' does not return values for all live properties. 1458 WebDAV servers increasingly have expensively-calculated or lengthy 1459 properties (see [RFC3253] and [RFC3744]) and do not return all 1460 properties already. Instead, WebDAV clients can use propname 1461 requests to discover what live properties exist, and request named 1462 properties when retrieving values. A WebDAV server MAY omit certain 1463 live properties from other specifications when responding to an 1464 'allprop' request, and MAY return only custom (dead) properties and 1465 those defined in this specification. 1467 All servers MUST support returning a response of content type text/ 1468 xml or application/xml that contains a multistatus XML element that 1469 describes the results of the attempts to retrieve the various 1470 properties. 1472 If there is an error retrieving a property then a proper error result 1473 MUST be included in the response. A request to retrieve the value of 1474 a property which does not exist is an error and MUST be noted, if the 1475 response uses a 'multistatus' XML element, with a 'response' XML 1476 element which contains a 404 (Not Found) status value. 1478 Consequently, the 'multistatus' XML element for a collection resource 1479 with member URLs MUST include a 'response' XML element for each 1480 member URL of the collection, to whatever depth was requested. Each 1481 'response' XML element MUST contain an 'href' XML element that 1482 contains the URL of the resource on which the properties in the prop 1483 XML element are defined. Results for a PROPFIND on a collection 1484 resource with internal member URLs are returned as a flat list whose 1485 order of entries is not significant. 1487 Properties may be subject to access control. In the case of 1488 'allprop' and 'propname' requests, if a principal does not have the 1489 right to know whether a particular property exists then the property 1490 MAY be silently excluded from the response. 1492 Some PROPFIND results MAY be cached, with care as there is no cache 1493 validation mechanism for most properties. This method is both safe 1494 and idempotent (see section 9.1 of [RFC2616]). 1496 8.2.1. PROPFIND status codes 1498 This section, as with similar sections for other methods, provides 1499 some guidance on error codes and preconditions or postconditions 1500 (defined in Section 15) that might be particularly useful with 1501 PROPFIND. 1503 403 Forbidden - A server MAY reject PROPFIND requests on collections 1504 with depth header of "Infinity", in which case it SHOULD use this 1505 error with the precondition code 'propfind-finite-depth' inside the 1506 error body. 1508 8.2.2. Status codes for use with 207 (Multi-Status) 1510 The following are examples of response codes one would expect to be 1511 used in a 207 (Multi-Status) response for this method. Note, 1512 however, that unless explicitly prohibited any 2/3/4/5xx series 1513 response code may be used in a 207 (Multi-Status) response. 1515 200 OK - A property exists and/or its value is successfully 1516 returned. 1518 401 Unauthorized - The property cannot be viewed without 1519 appropriate authorization. 1521 403 Forbidden - The property cannot be viewed regardless of 1522 authentication. 1524 404 Not Found - The property does not exist. 1526 8.2.3. Example - Retrieving Named Properties 1528 >>Request 1530 PROPFIND /file HTTP/1.1 1531 Host: www.example.com 1532 Content-type: application/xml; charset="utf-8" 1533 Content-Length: xxxx 1535 1536 1537 1538 1539 1540 1541 1542 1543 1545 >>Response 1547 HTTP/1.1 207 Multi-Status 1548 Content-Type: application/xml; charset="utf-8" 1549 Content-Length: xxxx 1551 1552 1553 1554 http://www.example.com/file 1555 1556 1557 1558 Box type A 1559 1560 1561 J.J. Johnson 1562 1563 1564 HTTP/1.1 200 OK 1565 1566 1567 1568 HTTP/1.1 403 Forbidden 1569 The user does not have access to the 1570 DingALing property. 1571 1572 1573 1574 There has been an access violation error. 1575 1576 1578 In this example, PROPFIND is executed on a non-collection resource 1579 http://www.example.com/file. The propfind XML element specifies the 1580 name of four properties whose values are being requested. In this 1581 case only two properties were returned, since the principal issuing 1582 the request did not have sufficient access rights to see the third 1583 and fourth properties. 1585 8.2.4. Example - Retrieving Named and Dead Properties 1587 >>Request 1589 PROPFIND /mycol/ HTTP/1.1 1590 Host: www.example.com 1591 Depth: 1 1592 Content-type: application/xml; charset="utf-8" 1593 Content-Length: xxxx 1595 1596 1597 1598 1599 1600 1601 1602 1604 In this example, PROPFIND is executed on a collection resource 1605 http://www.example.com/mycol/. The client requests the values of two 1606 specific live properties plus all dead properties (names and values). 1607 The response is not shown. 1609 8.2.5. Example - Using 'propname' to Retrieve all Property Names 1611 >>Request 1613 PROPFIND /container/ HTTP/1.1 1614 Host: www.example.com 1615 Content-Type: application/xml; charset="utf-8" 1616 Content-Length: xxxx 1618 1619 1620 1621 1623 >>Response 1625 HTTP/1.1 207 Multi-Status 1626 Content-Type: application/xml; charset="utf-8" 1627 Content-Length: xxxx 1629 1630 1631 1632 http://www.example.com/container/ 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 HTTP/1.1 200 OK 1643 1644 1645 1646 http://www.example.com/container/front.html 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 HTTP/1.1 200 OK 1660 1661 1662 1664 In this example, PROPFIND is invoked on the collection resource 1665 http://www.example.com/container/, with a propfind XML element 1666 containing the propname XML element, meaning the name of all 1667 properties should be returned. Since no Depth header is present, it 1668 assumes its default value of "infinity", meaning the name of the 1669 properties on the collection and all its descendents should be 1670 returned. 1672 Consistent with the previous example, resource 1673 http://www.example.com/container/ has six properties defined on it: 1674 bigbox and author in the "http://www.example.com/boxschema/" 1675 namespace, and creationdate, displayname, resourcetype, and 1676 supportedlock in the "DAV:" namespace. 1678 The resource http://www.example.com/container/index.html, a member of 1679 the "container" collection, has nine properties defined on it, bigbox 1680 in the "http://www.example.com/boxschema/" namespace and, 1681 creationdate, displayname, getcontentlength, getcontenttype, getetag, 1682 getlastmodified, resourcetype, and supportedlock in the "DAV:" 1683 namespace. 1685 This example also demonstrates the use of XML namespace scoping and 1686 the default namespace. Since the "xmlns" attribute does not contain 1687 a prefix, the namespace applies by default to all enclosed elements. 1688 Hence, all elements which do not explicitly state the namespace to 1689 which they belong are members of the "DAV:" namespace. 1691 8.2.6. Example - Using 'allprop' 1693 Note that 'allprop', despite its name which remains for backward- 1694 compatibility, does not return every property, but only dead 1695 properties and the live properties defined in this specification. 1697 >>Request 1699 PROPFIND /container/ HTTP/1.1 1700 Host: www.example.com 1701 Depth: 1 1702 Content-Type: application/xml; charset="utf-8" 1703 Content-Length: xxxx 1705 1706 1707 1708 1710 >>Response 1712 HTTP/1.1 207 Multi-Status 1713 Content-Type: application/xml; charset="utf-8" 1714 Content-Length: xxxx 1716 1717 1718 1719 /container/ 1720 1721 1722 Box type A 1723 Hadrian 1724 1997-12-01T17:42:21-08:00 1725 Example collection 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 HTTP/1.1 200 OK 1739 1740 1741 1742 /container/front.html 1743 1744 1745 Box type B 1746 1747 1997-12-01T18:27:21-08:00 1748 Example HTML resource 1749 4525 1750 text/html 1751 "zzyzx" 1752 Mon, 12 Jan 1998 09:25:56 GMT 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 HTTP/1.1 200 OK 1768 1769 1770 1772 In this example, PROPFIND was invoked on the resource 1773 http://www.foo.bar/container/ with a Depth header of 1, meaning the 1774 request applies to the resource and its children, and a propfind XML 1775 element containing the allprop XML element, meaning the request 1776 should return the name and value of all the dead properties defined 1777 on the resources, plus the name and value of all the properties 1778 defined in this specification. This example illustrates the use of 1779 relative references in the 'href' elements of the response. 1781 The resource http://www.foo.bar/container/ has six properties defined 1782 on it: 'bigbox' and 'author in the "http://www.foo.bar/boxschema/" 1783 namespace, DAV:creationdate, DAV:displayname, DAV:resourcetype, and 1784 DAV:supportedlock. 1786 The last four properties are WebDAV-specific, defined in Section 14. 1787 Since GET is not supported on this resource, the get* properties 1788 (e.g., DAV:getcontentlength) are not defined on this resource. The 1789 WebDAV-specific properties assert that "container" was created on 1790 December 1, 1997, at 5:42:21PM, in a time zone 8 hours west of GMT 1791 (DAV:creationdate), has a name of "Example collection" (DAV: 1792 displayname), a collection resource type (DAV:resourcetype), and 1793 supports exclusive write and shared write locks (DAV:supportedlock). 1795 The resource http://www.foo.bar/container/front.html has nine 1796 properties defined on it: 1798 'bigbox' in the "http://www.foo.bar/boxschema/" namespace (another 1799 instance of the "bigbox" property type), DAV:creationdate, DAV: 1800 displayname, DAV:getcontentlength, DAV:getcontenttype, DAV:getetag, 1801 DAV:getlastmodified, DAV:resourcetype, and DAV:supportedlock. 1803 The DAV-specific properties assert that "front.html" was created on 1804 December 1, 1997, at 6:27:21PM, in a time zone 8 hours west of GMT 1805 (DAV:creationdate), has a name of "Example HTML resource" (DAV: 1806 displayname), a content length of 4525 bytes (DAV:getcontentlength), 1807 a MIME type of "text/html" (DAV:getcontenttype), an entity tag of 1808 "zzyzx" (DAV:getetag), was last modified on Monday, January 12, 1998, 1809 at 09:25:56 GMT (DAV:getlastmodified), has an empty resource type, 1810 meaning that it is not a collection (DAV:resourcetype), and supports 1811 both exclusive write and shared write locks (DAV:supportedlock). 1813 8.3. PROPPATCH Method 1815 The PROPPATCH method processes instructions specified in the request 1816 body to set and/or remove properties defined on the resource 1817 identified by the Request-URI. 1819 All DAV compliant resources MUST support the PROPPATCH method and 1820 MUST process instructions that are specified using the 1821 propertyupdate, set, and remove XML elements. Execution of the 1822 directives in this method is, of course, subject to access control 1823 constraints. DAV compliant resources SHOULD support the setting of 1824 arbitrary dead properties. 1826 The request message body of a PROPPATCH method MUST contain the 1827 propertyupdate XML element. Clients SHOULD NOT alter the same 1828 property more than once in a single PROPPATCH request. 1830 Servers MUST process PROPPATCH instructions in document order (an 1831 exception to the normal rule that ordering is irrelevant). 1832 Instructions MUST either all be executed or none executed. Thus if 1833 any error occurs during processing all executed instructions MUST be 1834 undone and a proper error result returned. Instruction processing 1835 details can be found in the definition of the set and remove 1836 instructions in Section 13.22 and Section 13.25. 1838 This method is idempotent, but not safe (see section 9.1 of 1839 [RFC2616]). Responses to this method MUST NOT be cached. 1841 8.3.1. Status Codes for use in 207 (Multi-Status) 1843 The following are examples of response codes one would expect to be 1844 used in a 207 (Multi-Status) response for this method. Note, 1845 however, that unless explicitly prohibited any 2/3/4/5xx series 1846 response code may be used in a 207 (Multi-Status) response. 1848 200 (OK) - The property set or change succeeded. Note that if this 1849 appears for one property, it appears for every property in the 1850 response, due to the atomicity of PROPPATCH. 1852 403 (Forbidden) - The client, for reasons the server chooses not to 1853 specify, cannot alter one of the properties. 1855 403 (Forbidden): The client has attempted to set a read-only 1856 property, such as DAV:getetag. If returning this error, the server 1857 SHOULD use the precondition code 'writable-property' inside the 1858 response body. 1860 409 (Conflict) - The client has provided a value whose semantics are 1861 not appropriate for the property. 1863 424 (Failed Dependency) - The property change could not be made 1864 because of another property change that failed. 1866 507 (Insufficient Storage) - The server did not have sufficient space 1867 to record the property. 1869 8.3.2. Example - PROPPATCH 1871 >>Request 1873 PROPPATCH /bar.html HTTP/1.1 1874 Host: www.example.com 1875 Content-Type: application/xml; charset="utf-8" 1876 Content-Length: xxxx 1878 1879 1881 1882 1883 1884 Jim Whitehead 1885 Roy Fielding 1886 1887 1888 1889 1890 1891 1892 1894 >>Response 1896 HTTP/1.1 207 Multi-Status 1897 Content-Type: application/xml; charset="utf-8" 1898 Content-Length: xxxx 1900 1901 1903 1904 http://www.example.com/bar.html 1905 1906 1907 HTTP/1.1 424 Failed Dependency 1908 1909 1910 1911 HTTP/1.1 409 Conflict 1912 1913 Copyright Owner can not be deleted or 1914 altered. 1915 1916 1918 In this example, the client requests the server to set the value of 1919 the "Authors" property in the "http://www.w3.com/standards/z39.50/" 1920 namespace, and to remove the property "Copyright-Owner" in the 1921 "http://www.w3.com/standards/z39.50/" namespace. Since the 1922 Copyright-Owner property could not be removed, no property 1923 modifications occur. The 424 (Failed Dependency) status code for the 1924 Authors property indicates this action would have succeeded if it 1925 were not for the conflict with removing the Copyright-Owner property. 1927 8.4. MKCOL Method 1929 The MKCOL method is used to create a new collection. All WebDAV 1930 compliant resources MUST support the MKCOL method. 1932 MKCOL creates a new collection resource at the location specified by 1933 the Request-URI. If the Request-URI is already mapped to a resource 1934 then the MKCOL MUST fail. During MKCOL processing, a server MUST 1935 make the Request-URI a member of its parent collection, unless the 1936 Request-URI is "/". If no such ancestor exists, the method MUST 1937 fail. When the MKCOL operation creates a new collection resource, 1938 all ancestors MUST already exist, or the method MUST fail with a 409 1939 (Conflict) status code. For example, if a request to create 1940 collection /a/b/c/d/ is made, and /a/b/c/ does not exist, the request 1941 must fail. 1943 When MKCOL is invoked without a request body, the newly created 1944 collection SHOULD have no members. 1946 A MKCOL request message may contain a message body. The precise 1947 behavior of a MKCOL request when the body is present is undefined, 1948 but limited to creating collections, members of a collection, bodies 1949 of members and properties on the collections or members. If the 1950 server receives a MKCOL request entity type it does not support or 1951 understand it MUST respond with a 415 (Unsupported Media Type) status 1952 code. If the server decides to reject the request based on the 1953 presence of an entity or the type of an entity, it should use the 415 1954 (Unsupported Media Type) status code. 1956 This method is idempotent, but not safe (see section 9.1 of 1957 [RFC2616]). Responses to this method MUST NOT be cached. 1959 8.4.1. MKCOL Status Codes 1961 In addition to the general status codes possible, the following 1962 status codes have specific applicability to MKCOL: 1964 201 (Created) - The collection was created. 1966 403 (Forbidden) - This indicates at least one of two conditions: 1) 1967 the server does not allow the creation of collections at the given 1968 location in its URL namespace, or 2) the parent collection of the 1969 Request-URI exists but cannot accept members. 1971 405 (Method Not Allowed) - MKCOL can only be executed on an unmapped 1972 URL. 1974 409 (Conflict) - A collection cannot be made at the Request-URI until 1975 one or more intermediate collections have been created. The server 1976 MUST NOT create those intermediate collections automatically. 1978 415 (Unsupported Media Type) - The server does not support the 1979 request body type (since this specification does not define any body 1980 for MKCOL requests). 1982 507 (Insufficient Storage) - The resource does not have sufficient 1983 space to record the state of the resource after the execution of this 1984 method. 1986 8.4.2. Example - MKCOL 1988 This example creates a collection called /webdisc/xfiles/ on the 1989 server www.example.com. 1991 >>Request 1993 MKCOL /webdisc/xfiles/ HTTP/1.1 1994 Host: www.example.com 1996 >>Response 1998 HTTP/1.1 201 Created 2000 8.5. GET, HEAD for Collections 2002 The semantics of GET are unchanged when applied to a collection, 2003 since GET is defined as, "retrieve whatever information (in the form 2004 of an entity) is identified by the Request-URI" [RFC2616]. GET when 2005 applied to a collection may return the contents of an "index.html" 2006 resource, a human-readable view of the contents of the collection, or 2007 something else altogether. Hence it is possible that the result of a 2008 GET on a collection will bear no correlation to the membership of the 2009 collection. 2011 Similarly, since the definition of HEAD is a GET without a response 2012 message body, the semantics of HEAD are unmodified when applied to 2013 collection resources. 2015 8.6. POST for Collections 2017 Since by definition the actual function performed by POST is 2018 determined by the server and often depends on the particular 2019 resource, the behavior of POST when applied to collections cannot be 2020 meaningfully modified because it is largely undefined. Thus the 2021 semantics of POST are unmodified when applied to a collection. 2023 8.7. DELETE Requirements 2025 DELETE is defined in [RFC2616], section 9.7, to "delete the resource 2026 identified by the Request-URI". However, WebDAV changes some DELETE 2027 handling requirements. 2029 A server processing a successful DELETE request: 2031 MUST destroy locks rooted on the deleted resource 2033 MUST remove the mapping from the Request-URI to any resource. 2035 Thus, after a successful DELETE operation (and in the absence of 2036 other actions) a subsequent GET/HEAD/PROPFIND request to the target 2037 Request-URI MUST return 404 (Not Found). 2039 8.7.1. DELETE for Collections 2041 The DELETE method on a collection MUST act as if a "Depth: infinity" 2042 header was used on it. A client MUST NOT submit a Depth header with 2043 a DELETE on a collection with any value but infinity. 2045 DELETE instructs that the collection specified in the Request-URI and 2046 all resources identified by its internal member URLs are to be 2047 deleted. 2049 If any resource identified by a member URL cannot be deleted then all 2050 of the member's ancestors MUST NOT be deleted, so as to maintain URL 2051 namespace consistency. 2053 Any headers included with DELETE MUST be applied in processing every 2054 resource to be deleted. 2056 When the DELETE method has completed processing it MUST result in a 2057 consistent URL namespace. 2059 If an error occurs deleting an internal resource (a resource other 2060 than the resource identified in the Request-URI) then the response 2061 can be a 207 (Multi-Status). Multi-Status is used here to indicate 2062 which internal resources could NOT be deleted, including an error 2063 code which should help the client understand which resources caused 2064 the failure. For example, the Multi-Status body could include a 2065 response with status 423 (Locked) if an internal resource was locked. 2067 The server MAY return a 4xx status response, rather than a 207, if 2068 the request failed completely. 2070 424 (Failed Dependency) status codes SHOULD NOT be in the 207 (Multi- 2071 Status) response for DELETE. They can be safely left out because the 2072 client will know that the ancestors of a resource could not be 2073 deleted when the client receives an error for the ancestor's progeny. 2074 Additionally 204 (No Content) errors SHOULD NOT be returned in the 2075 207 (Multi-Status). The reason for this prohibition is that 204 (No 2076 Content) is the default success code. 2078 8.7.2. Example - DELETE 2080 >>Request 2082 DELETE /container/ HTTP/1.1 2083 Host: www.example.com 2085 >>Response 2087 HTTP/1.1 207 Multi-Status 2088 Content-Type: application/xml; charset="utf-8" 2089 Content-Length: xxxx 2091 2092 2093 2094 http://www.example.com/container/resource3 2095 HTTP/1.1 423 Locked 2096 2097 2099 In this example the attempt to delete 2100 http://www.example.com/container/resource3 failed because it is 2101 locked, and no lock token was submitted with the request. 2102 Consequently, the attempt to delete http://www.example.com/container/ 2103 also failed. Thus the client knows that the attempt to delete 2104 http://www.example.com/container/ must have also failed since the 2105 parent can not be deleted unless its child has also been deleted. 2106 Even though a Depth header has not been included, a depth of infinity 2107 is assumed because the method is on a collection. 2109 8.8. PUT Requirements 2111 8.8.1. PUT for Non-Collection Resources 2113 A PUT performed on an existing resource replaces the GET response 2114 entity of the resource. Properties defined on the resource may be 2115 recomputed during PUT processing but are not otherwise affected. For 2116 example, if a server recognizes the content type of the request body, 2117 it may be able to automatically extract information that could be 2118 profitably exposed as properties. 2120 A PUT that would result in the creation of a resource without an 2121 appropriately scoped parent collection MUST fail with a 409 2122 (Conflict). 2124 A PUT request is the only way a client has to indicate to the server 2125 what Content-Type a resource should have, and whether it should 2126 change if the resource is overwritten. Thus, a client MUST provide a 2127 Content-Type for a new resource if any is known, and a server SHOULD 2128 use the Content-Type header value on any PUT request as the 2129 resource's type (unless security concerns or policy dictates 2130 otherwise). 2132 Note that although a recipient should treat metadata supplied with an 2133 HTTP request as authorative, in practice there's no guarantee that a 2134 server will accept Content- headers. Many servers do not allow 2135 configuring the Content-Type on a per-resource basis in the first 2136 place. Thus, clients should not rely on the ability to directly 2137 influence the content type by including a Content-Type request 2138 header. 2140 8.8.2. PUT for Collections 2142 This specification does not define the behavior of the PUT method for 2143 existing collections. A PUT request to an existing collection MAY be 2144 treated as an error (405 Method Not Allowed). 2146 The MKCOL method is defined to create collections. 2148 8.9. COPY Method 2150 The COPY method creates a duplicate of the source resource identified 2151 by the Request-URI, in the destination resource identified by the URI 2152 in the Destination header. The Destination header MUST be present. 2153 The exact behavior of the COPY method depends on the type of the 2154 source resource. 2156 All WebDAV compliant resources MUST support the COPY method. 2157 However, support for the COPY method does not guarantee the ability 2158 to copy a resource. For example, separate programs may control 2159 resources on the same server. As a result, it may not be possible to 2160 copy a resource to a location that appears to be on the same server. 2162 This method is idempotent, but not safe (see section 9.1 of 2163 [RFC2616]). Responses to this method MUST NOT be cached. 2165 8.9.1. COPY for Non-collection Resources 2167 When the source resource is not a collection the result of the COPY 2168 method is the creation of a new resource at the destination whose 2169 state and behavior match that of the source resource as closely as 2170 possible. Since the environment at the destination may be different 2171 than at the source due to factors outside the scope of control of the 2172 server, such as the absence of resources required for correct 2173 operation, it may not be possible to completely duplicate the 2174 behavior of the resource at the destination. Subsequent alterations 2175 to the destination resource will not modify the source resource. 2176 Subsequent alterations to the source resource will not modify the 2177 destination resource. 2179 8.9.2. COPY for Properties 2181 After a successful COPY invocation, all dead properties on the source 2182 resource MUST be duplicated on the destination resource, along with 2183 all properties as appropriate. Live properties described in this 2184 document SHOULD be duplicated as identically behaving live properties 2185 at the destination resource, but not necessarily with the same 2186 values. Servers SHOULD NOT convert live properties into dead 2187 properties on the destination resource, because clients may then draw 2188 incorrect conclusions about the state or functionality of a resource. 2189 Note that some live properties are defined such that the absence of 2190 the property has a specific meaning (e.g. a flag with one meaning if 2191 present and the opposite if absent), and in these cases, a successful 2192 COPY might result in the property being reported as "Not Found" in 2193 subsequent requests. 2195 A COPY operation creates a new resource, much like a PUT operation 2196 does. Live properties which are related to resource creation (such 2197 as DAV:creationdate) should have their values set accordingly. 2199 8.9.3. COPY for Collections 2201 The COPY method on a collection without a Depth header MUST act as if 2202 a Depth header with value "infinity" was included. A client may 2203 submit a Depth header on a COPY on a collection with a value of "0" 2204 or "infinity". Servers MUST support the "0" and "infinity" Depth 2205 header behaviors on WebDAV-compliant resources. 2207 A COPY of depth infinity instructs that the collection resource 2208 identified by the Request-URI is to be copied to the location 2209 identified by the URI in the Destination header, and all its internal 2210 member resources are to be copied to a location relative to it, 2211 recursively through all levels of the collection hierarchy. Note 2212 that a depth infinity COPY of /A/ into /A/B/ could lead to infinite 2213 recursion if not handled correctly. 2215 A COPY of "Depth: 0" only instructs that the collection and its 2216 properties but not resources identified by its internal member URLs, 2217 are to be copied. 2219 Any headers included with a COPY MUST be applied in processing every 2220 resource to be copied with the exception of the Destination header. 2222 The Destination header only specifies the destination URI for the 2223 Request-URI. When applied to members of the collection identified by 2224 the Request-URI the value of Destination is to be modified to reflect 2225 the current location in the hierarchy. So, if the Request-URI is /a/ 2226 with Host header value http://example.com/ and the Destination is 2227 http://example.com/b/ then when http://example.com/a/c/d is processed 2228 it must use a Destination of http://example.com/b/c/d. 2230 When the COPY method has completed processing it MUST have created a 2231 consistent URL namespace at the destination (see Section 5.1 for the 2232 definition of namespace consistency). However, if an error occurs 2233 while copying an internal collection, the server MUST NOT copy any 2234 resources identified by members of this collection (i.e., the server 2235 must skip this subtree), as this would create an inconsistent 2236 namespace. After detecting an error, the COPY operation SHOULD try 2237 to finish as much of the original copy operation as possible (i.e., 2238 the server should still attempt to copy other subtrees and their 2239 members, that are not descendents of an error-causing collection). 2241 So, for example, if an infinite depth copy operation is performed on 2242 collection /a/, which contains collections /a/b/ and /a/c/, and an 2243 error occurs copying /a/b/, an attempt should still be made to copy 2244 /a/c/. Similarly, after encountering an error copying a non- 2245 collection resource as part of an infinite depth copy, the server 2246 SHOULD try to finish as much of the original copy operation as 2247 possible. 2249 If an error in executing the COPY method occurs with a resource other 2250 than the resource identified in the Request-URI then the response 2251 MUST be a 207 (Multi-Status), and the URL of the resource causing the 2252 failure MUST appear with the specific error. 2254 The 424 (Failed Dependency) status code SHOULD NOT be returned in the 2255 207 (Multi-Status) response from a COPY method. These responses can 2256 be safely omitted because the client will know that the progeny of a 2257 resource could not be copied when the client receives an error for 2258 the parent. Additionally 201 (Created)/204 (No Content) status codes 2259 SHOULD NOT be returned as values in 207 (Multi-Status) responses from 2260 COPY methods. They, too, can be safely omitted because they are the 2261 default success codes. 2263 8.9.4. COPY and Overwriting Destination Resources 2265 If a COPY request has an Overwrite header with a value of "F", and a 2266 resource exists at the Destination URL, the server MUST fail the 2267 request. 2269 When a server executes a COPY request and overwrites a destination 2270 resource, the exact behavior MAY depend on many factors, including 2271 WebDAV extension capabilities (see particularly [RFC3253]). For 2272 example, when an ordinary resource is overwritten, the server could 2273 delete the target resource before doing the copy, or could do an in- 2274 place overwrite to preserve live properties. 2276 When a collection is overwritten, the membership of the destination 2277 collection after the successful COPY request MUST be the same 2278 membership as the source collection immediately before the COPY. 2279 Thus, merging the membership of the source and destination 2280 collections together in the destination is not a compliant behavior. 2282 In general, if clients require the state of the destination URL to be 2283 wiped out prior to a COPY (e.g. to force live properties to be 2284 reset), then the client could send a DELETE to the destination before 2285 the COPY request to ensure this reset. 2287 8.9.5. Status Codes 2289 In addition to the general status codes possible, the following 2290 status codes have specific applicability to COPY: 2292 201 (Created) - The source resource was successfully copied. The 2293 COPY operation resulted in the creation of a new resource. 2295 204 (No Content) - The source resource was successfully copied to a 2296 pre-existing destination resource. 2298 207 (Multi-Status) - Multiple resources were to be affected by the 2299 COPY, but errors on some of them prevented the operation from taking 2300 place. Specific error messages, together with the most appropriate 2301 of the source and destination URLs, appear in the body of the multi- 2302 status response. E.g. if a destination resource was locked and could 2303 not be overwritten, then the destination resource URL appears with 2304 the 423 (Locked) status. 2306 403 (Forbidden) - The operation is forbidden. A special case for 2307 COPY could be that the source and destination resources are the same 2308 resource. 2310 409 (Conflict) - A resource cannot be created at the destination 2311 until one or more intermediate collections have been created. The 2312 server MUST NOT create those intermediate collections automatically. 2314 412 (Precondition Failed) - A precondition header check failed, e.g. 2315 the Overwrite header is "F" and the destination URL is already mapped 2316 to a resource. 2318 423 (Locked) - The destination resource, or resource within the 2319 destination collection, was locked. This response SHOULD contain the 2320 'lock-token-present' precondition element. 2322 502 (Bad Gateway) - This may occur when the destination is on another 2323 server, repository or URL namespace. Either the source namespace 2324 does not support copying to the destination namespace, or the 2325 destination namespace refuses to accept the resource. The client may 2326 wish to try GET/PUT and PROPFIND/PROPPATCH instead. 2328 507 (Insufficient Storage) - The destination resource does not have 2329 sufficient space to record the state of the resource after the 2330 execution of this method. 2332 8.9.6. Example - COPY with Overwrite 2334 This example shows resource 2335 http://www.ics.uci.edu/~fielding/index.html being copied to the 2336 location http://www.ics.uci.edu/users/f/fielding/index.html. The 204 2337 (No Content) status code indicates the existing resource at the 2338 destination was overwritten. 2340 >>Request 2342 COPY /~fielding/index.html HTTP/1.1 2343 Host: www.ics.uci.edu 2344 Destination: http://www.ics.uci.edu/users/f/fielding/index.html 2346 >>Response 2348 HTTP/1.1 204 No Content 2350 8.9.7. Example - COPY with No Overwrite 2352 The following example shows the same copy operation being performed, 2353 but with the Overwrite header set to "F." A response of 412 2354 (Precondition Failed) is returned because the destination URL is 2355 already mapped to a resource. 2357 >>Request 2359 COPY /~fielding/index.html HTTP/1.1 2360 Host: www.ics.uci.edu 2361 Destination: http://www.ics.uci.edu/users/f/fielding/index.html 2362 Overwrite: F 2364 >>Response 2366 HTTP/1.1 412 Precondition Failed 2368 8.9.8. Example - COPY of a Collection 2370 >>Request 2372 COPY /container/ HTTP/1.1 2373 Host: www.example.com 2374 Destination: http://www.example.com/othercontainer/ 2375 Depth: infinity 2377 >>Response 2379 HTTP/1.1 207 Multi-Status 2380 Content-Type: application/xml; charset="utf-8" 2381 Content-Length: xxxx 2383 2385 2386 2387 http://www.example.com/othercontainer/R2/ 2388 HTTP/1.1 423 Locked 2389 2390 2392 The Depth header is unnecessary as the default behavior of COPY on a 2393 collection is to act as if a "Depth: infinity" header had been 2394 submitted. In this example most of the resources, along with the 2395 collection, were copied successfully. However the collection R2 2396 failed because the destination R2 is locked. Because there was an 2397 error copying R2, none of R2's members were copied. However no 2398 errors were listed for those members due to the error minimization 2399 rules. 2401 8.10. MOVE Method 2403 The MOVE operation on a non-collection resource is the logical 2404 equivalent of a copy (COPY), followed by consistency maintenance 2405 processing, followed by a delete of the source, where all three 2406 actions are performed atomically. The consistency maintenance step 2407 allows the server to perform updates caused by the move, such as 2408 updating all URLs other than the Request-URI which identify the 2409 source resource, to point to the new destination resource. 2410 Consequently, the Destination header MUST be present on all MOVE 2411 methods and MUST follow all COPY requirements for the COPY part of 2412 the MOVE method. All WebDAV compliant resources MUST support the 2413 MOVE method. However, support for the MOVE method does not guarantee 2414 the ability to move a resource to a particular destination. 2416 For example, separate programs may actually control different sets of 2417 resources on the same server. Therefore, it may not be possible to 2418 move a resource within a namespace that appears to belong to the same 2419 server. 2421 If a resource exists at the destination, the destination resource 2422 will be deleted as a side-effect of the MOVE operation, subject to 2423 the restrictions of the Overwrite header. 2425 This method is idempotent, but not safe (see section 9.1 of 2426 [RFC2616]). Responses to this method MUST NOT be cached. 2428 8.10.1. MOVE for Properties 2430 Live properties described in this document SHOULD be moved along with 2431 the resource, such that the resource has identically behaving live 2432 properties at the destination resource, but not necessarily with the 2433 same values. Note that some live properties are defined such that 2434 the absence of the property has a specific meaning (e.g. a flag with 2435 one meaning if present and the opposite if absent), and in these 2436 cases, a successful MOVE might result in the property being reported 2437 as "Not Found" in subsequent requests. If the live properties will 2438 not work the same way at the destination, the server MAY fail the 2439 request. 2441 MOVE is frequently used by clients to rename a file without changing 2442 its parent collection, so it's not appropriate to reset all live 2443 properties which are set at resource creation. For example, the DAV: 2444 creationdate property value SHOULD remain the same after a MOVE. 2446 Dead properties MUST be moved along with the resource. 2448 8.10.2. MOVE for Collections 2450 A MOVE with "Depth: infinity" instructs that the collection 2451 identified by the Request-URI be moved to the address specified in 2452 the Destination header, and all resources identified by its internal 2453 member URLs are to be moved to locations relative to it, recursively 2454 through all levels of the collection hierarchy. 2456 The MOVE method on a collection MUST act as if a "Depth: infinity" 2457 header was used on it. A client MUST NOT submit a Depth header on a 2458 MOVE on a collection with any value but "infinity". 2460 Any headers included with MOVE MUST be applied in processing every 2461 resource to be moved with the exception of the Destination header. 2462 The behavior of the Destination header is the same as given for COPY 2463 on collections. 2465 When the MOVE method has completed processing it MUST have created a 2466 consistent URL namespace at both the source and destination (see 2467 section 5.1 for the definition of namespace consistency). However, 2468 if an error occurs while moving an internal collection, the server 2469 MUST NOT move any resources identified by members of the failed 2470 collection (i.e., the server must skip the error-causing subtree), as 2471 this would create an inconsistent namespace. In this case, after 2472 detecting the error, the move operation SHOULD try to finish as much 2473 of the original move as possible (i.e., the server should still 2474 attempt to move other subtrees and the resources identified by their 2475 members, that are not descendents of an error-causing collection). 2476 So, for example, if an infinite depth move is performed on collection 2477 /a/, which contains collections /a/b/ and /a/c/, and an error occurs 2478 moving /a/b/, an attempt should still be made to try moving /a/c/. 2479 Similarly, after encountering an error moving a non-collection 2480 resource as part of an infinite depth move, the server SHOULD try to 2481 finish as much of the original move operation as possible. 2483 If an error occurs with a resource other than the resource identified 2484 in the Request-URI then the response MUST be a 207 (Multi-Status), 2485 and the errored resource's URL MUST appear with the specific error. 2487 The 424 (Failed Dependency) status code SHOULD NOT be returned in the 2488 207 (Multi-Status) response from a MOVE method. These errors can be 2489 safely omitted because the client will know that the progeny of a 2490 resource could not be moved when the client receives an error for the 2491 parent. Additionally 201 (Created)/204 (No Content) responses SHOULD 2492 NOT be returned as values in 207 (Multi-Status) responses from a 2493 MOVE. These responses can be safely omitted because they are the 2494 default success codes. 2496 8.10.3. MOVE and the Overwrite Header 2498 If a resource exists at the destination and the Overwrite header is 2499 "T" then prior to performing the move the server MUST perform a 2500 DELETE with "Depth: infinity" on the destination resource. If the 2501 Overwrite header is set to "F" then the operation will fail. 2503 8.10.4. Status Codes 2505 In addition to the general status codes possible, the following 2506 status codes have specific applicability to MOVE: 2508 201 (Created) - The source resource was successfully moved, and a new 2509 URL mapping was created at the destination. 2511 204 (No Content) - The source resource was successfully moved to a 2512 URL that was already mapped. 2514 207 (Multi-Status) - Multiple resources were to be affected by the 2515 MOVE, but errors on some of them prevented the operation from taking 2516 place. Specific error messages, together with the most appropriate 2517 of the source and destination URLs, appear in the body of the multi- 2518 status response. E.g. if a source resource was locked and could not 2519 be moved, then the source resource URL appears with the 423 (Locked) 2520 status. 2522 403 (Forbidden) - Among many possible reasons for forbidding a MOVE 2523 operation, this status code is recommended for use when the source 2524 and destination resources are the same. 2526 409 (Conflict) - A resource cannot be created at the destination 2527 until one or more intermediate collections have been created. The 2528 server MUST NOT create those intermediate collections automatically. 2529 Or, the server was unable to preserve the behavior of the live 2530 properties and still move the resource to the destination (see 2531 'preserved-live-properties' postcondition). 2533 412 (Precondition Failed) - A condition header failed. Specific to 2534 MOVE, this could mean that the Overwrite header is "F" and the state 2535 of the destination URL is already mapped to a resource. 2537 423 (Locked) - The source or the destination resource, the source or 2538 destination resource parent, or some resource within the source or 2539 destination collection, was locked. This response SHOULD contain the 2540 'lock-token-present' precondition element. 2542 502 (Bad Gateway) - This may occur when the destination is on another 2543 server and the destination server refuses to accept the resource. 2544 This could also occur when the destination is on another sub-section 2545 of the same server namespace. 2547 8.10.5. Example - MOVE of a Non-Collection 2549 This example shows resource 2550 http://www.ics.uci.edu/~fielding/index.html being moved to the 2551 location http://www.ics.uci.edu/users/f/fielding/index.html. The 2552 contents of the destination resource would have been overwritten if 2553 the destination URL was already mapped to a resource. In this case, 2554 since there was nothing at the destination resource, the response 2555 code is 201 (Created). 2557 >>Request 2559 MOVE /~fielding/index.html HTTP/1.1 2560 Host: www.ics.uci.edu 2561 Destination: http://www.ics.uci.edu/users/f/fielding/index.html 2563 >>Response 2565 HTTP/1.1 201 Created 2566 Location: http://www.ics.uci.edu/users/f/fielding/index.html 2568 8.10.6. Example - MOVE of a Collection 2570 >>Request 2572 MOVE /container/ HTTP/1.1 2573 Host: www.example.com 2574 Destination: http://www.example.com/othercontainer/ 2575 Overwrite: F 2576 If: () 2577 () 2579 >>Response 2581 HTTP/1.1 207 Multi-Status 2582 Content-Type: application/xml; charset="utf-8" 2583 Content-Length: xxxx 2585 2586 2587 2588 http://www.example.com/othercontainer/C2/ 2589 HTTP/1.1 423 Locked 2590 2591 2593 In this example the client has submitted a number of lock tokens with 2594 the request. A lock token will need to be submitted for every 2595 resource, both source and destination, anywhere in the scope of the 2596 method, that is locked. In this case the proper lock token was not 2597 submitted for the destination 2598 http://www.example.com/othercontainer/C2/. This means that the 2599 resource /container/C2/ could not be moved. Because there was an 2600 error moving /container/C2/, none of /container/C2's members were 2601 moved. However no errors were listed for those members due to the 2602 error minimization rules. User agent authentication has previously 2603 occurred via a mechanism outside the scope of the HTTP protocol, in 2604 an underlying transport layer. 2606 8.11. LOCK Method 2608 The following sections describe the LOCK method, which is used to 2609 take out a lock of any access type and to refresh an existing lock. 2610 These sections on the LOCK method describe only those semantics that 2611 are specific to the LOCK method and are independent of the access 2612 type of the lock being requested. 2614 Any resource which supports the LOCK method MUST, at minimum, support 2615 the XML request and response formats defined herein. 2617 A LOCK method invocation to an unlocked resource creates a lock on 2618 the resource identified by the Request-URI, which becomes the root of 2619 the lock. Lock method requests to create a new lock MUST have a XML 2620 request body which contains an 'owner' XML element and other 2621 information for this lock request. The server MUST preserve the 2622 information provided by the client in the 'owner' field when the lock 2623 information is requested. The LOCK request MAY have a Timeout 2624 header. 2626 Clients MUST assume that locks may arbitrarily disappear at any time, 2627 regardless of the value given in the Timeout header. The Timeout 2628 header only indicates the behavior of the server if extraordinary 2629 circumstances do not occur. For example, a sufficiently privileged 2630 user may remove a lock at any time or the system may crash in such a 2631 way that it loses the record of the lock's existence. 2633 When a new lock is created, the LOCK response: 2635 o MUST contain a body with the value of the DAV:lockdiscovery 2636 property in a prop XML element. This MUST contain the full 2637 information about the lock just granted, while information about 2638 other (shared) locks is OPTIONAL. 2640 o MUST include the Lock-Token response header with the token 2641 associated with the new lock. 2643 This method is neither idempotent nor safe (see section 9.1 of 2644 [RFC2616]). Responses to this method MUST NOT be cached. 2646 8.11.1. Refreshing Locks 2648 A lock is refreshed by sending a LOCK request without a request body 2649 to the URL of a resource within the scope of the lock. This request 2650 MUST specify which lock to refresh by using the 'Lock-Token' header 2651 with a single lock token (only one lock may be refreshed at a time). 2652 It MAY contain a Timeout header, which a server MAY accept to change 2653 the duration remaining on the lock to the new value. A server MUST 2654 ignore the Depth header on a LOCK refresh. 2656 If the resource has other (shared) locks, those locks are unaffected 2657 by a lock refresh. Additionally, those locks do not prevent the 2658 named lock from being refreshed. 2660 Note that in RFC2518, clients were indicated through the example in 2661 the text to use the If header to specify what lock to refresh (rather 2662 than the Lock-Token header). Servers are encouraged to continue to 2663 support this as well as the Lock-Token header. 2665 Note that the Lock-Token header is not be returned in the response 2666 for a successful refresh LOCK request, but the LOCK response body 2667 MUST contain the new value for the DAV:lockdiscovery body. 2669 8.11.2. Depth and Locking 2671 The Depth header may be used with the LOCK method. Values other than 2672 0 or infinity MUST NOT be used with the Depth header on a LOCK 2673 method. All resources that support the LOCK method MUST support the 2674 Depth header. 2676 A Depth header of value 0 means to just lock the resource specified 2677 by the Request-URI. 2679 If the Depth header is set to infinity then the resource specified in 2680 the Request-URI along with all its internal members, all the way down 2681 the hierarchy, are to be locked. A successful result MUST return a 2682 single lock token which represents all the resources that have been 2683 locked. If an UNLOCK is successfully executed on this token, all 2684 associated resources are unlocked. Hence, partial success is not an 2685 option. Either the entire hierarchy is locked or no resources are 2686 locked. 2688 If the lock cannot be granted to all resources, the server MUST 2689 return a Multi-Status response with a 'response' element for at least 2690 one resource which prevented the lock from being granted, along with 2691 a suitable status code for that failure (e.g. 403 (Forbidden) or 423 2692 (Locked)). Additionally, if the resource causing the failure was not 2693 the resource requested, then the server SHOULD include a 'response' 2694 element for the Request-URI as well, with a 'status' element 2695 containing 424 Failed Dependency. 2697 If no Depth header is submitted on a LOCK request then the request 2698 MUST act as if a "Depth:infinity" had been submitted. 2700 8.11.3. Locking Unmapped URLs 2702 A successful LOCK method MUST result in the creation of an empty 2703 resource which is locked (and which is not a collection), when a 2704 resource did not previously exist at that URL. Later on, the lock 2705 may go away but the empty resource remains. Empty resources MUST 2706 then appear in PROPFIND responses including that URL in the response 2707 scope. A server MUST respond successfully to a GET request to an 2708 empty resource, either by using a 204 No Content response, or by 2709 using 200 OK with a Content-Length header indicating zero length and 2710 no Content-Type. 2712 8.11.4. Lock Compatibility Table 2714 The table below describes the behavior that occurs when a lock 2715 request is made on a resource. 2717 +--------------------------+----------------+-------------------+ 2718 | Current State | Shared Lock OK | Exclusive Lock OK | 2719 +--------------------------+----------------+-------------------+ 2720 | None | True | True | 2721 | | | | 2722 | Shared Lock | True | False | 2723 | | | | 2724 | Exclusive Lock | False | False* | 2725 +--------------------------+----------------+-------------------+ 2727 Legend: True = lock may be granted. False = lock MUST NOT be 2728 granted. *=It is illegal for a principal to request the same lock 2729 twice. 2731 The current lock state of a resource is given in the leftmost column, 2732 and lock requests are listed in the first row. The intersection of a 2733 row and column gives the result of a lock request. For example, if a 2734 shared lock is held on a resource, and an exclusive lock is 2735 requested, the table entry is "false", indicating the lock must not 2736 be granted. 2738 8.11.5. LOCK Responses 2740 In addition to the general status codes possible, the following 2741 status codes have specific applicability to LOCK: 2743 200 (OK) - The LOCK request succeeded and the value of the DAV: 2744 lockdiscovery property is included in the response body. 2746 201 (Created) - The LOCK request was to an unmapped URL, the request 2747 succeeded and resulted in the creation of a new resource, and the 2748 value of the DAV:lockdiscovery property is included in the response 2749 body. 2751 409 (Conflict) - A resource cannot be created at the destination 2752 until one or more intermediate collections have been created. The 2753 server MUST NOT create those intermediate collections automatically. 2755 423 (Locked), potentially with 'no-conflicting-lock' precondition 2756 code - There is already a lock on the resource which is not 2757 compatible with the requested lock (see lock compatibility table 2758 above). 2760 400 (Bad Request), with 'lock-token-matches-request-uri' precondition 2761 code - The LOCK request was made with a Lock-Token header, indicating 2762 that the client wishes to refresh the given lock. However, the 2763 Request-URI did not fall within the scope of the lock identified by 2764 the token. The lock may have a scope that does not include the 2765 Request-URI, or the lock could have disappeared, or the token may be 2766 invalid. 2768 8.11.6. Example - Simple Lock Request 2770 >>Request 2772 LOCK /workspace/webdav/proposal.doc HTTP/1.1 2773 Host: example.com 2774 Timeout: Infinite, Second-4100000000 2775 Content-Type: application/xml; charset="utf-8" 2776 Content-Length: xxxx 2777 Authorization: Digest username="ejw", 2778 realm="ejw@example.com", nonce="...", 2779 uri="/workspace/webdav/proposal.doc", 2780 response="...", opaque="..." 2782 2783 2784 2785 2786 2787 http://www.ics.uci.edu/~ejw/contact.html 2788 2789 2791 >>Response 2793 HTTP/1.1 200 OK 2794 Lock-Token: 2795 Content-Type: application/xml; charset="utf-8" 2796 Content-Length: xxxx 2798 2799 2800 2801 2802 2803 2804 infinity 2805 2806 http://www.ics.uci.edu/~ejw/contact.html 2807 2808 Second-604800 2809 2810 urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4 2812 2813 2814 http://example.com/workspace/webdav/proposal.doc 2816 2817 2818 2819 2821 This example shows the successful creation of an exclusive write lock 2822 on resource http://example.com/workspace/webdav/proposal.doc. The 2823 resource http://www.ics.uci.edu/~ejw/contact.html contains contact 2824 information for the creator of the lock. The server has an activity- 2825 based timeout policy in place on this resource, which causes the lock 2826 to automatically be removed after 1 week (604800 seconds). Note that 2827 the nonce, response, and opaque fields have not been calculated in 2828 the Authorization request header. 2830 8.11.7. Example - Refreshing a Write Lock 2832 >>Request 2834 LOCK /workspace/webdav/proposal.doc HTTP/1.1 2835 Host: example.com 2836 Timeout: Infinite, Second-4100000000 2837 Lock-Token: 2838 Authorization: Digest username="ejw", 2839 realm="ejw@example.com", nonce="...", 2840 uri="/workspace/webdav/proposal.doc", 2841 response="...", opaque="..." 2843 >>Response 2845 HTTP/1.1 200 OK 2846 Content-Type: application/xml; charset="utf-8" 2847 Content-Length: xxxx 2849 2850 2851 2852 2853 2854 2855 infinity 2856 2857 http://www.ics.uci.edu/~ejw/contact.html 2858 2859 Second-604800 2860 2861 urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4 2863 2864 2865 http://example.com/workspace/webdav/proposal.doc 2867 2868 2869 2870 2872 This request would refresh the lock, attempting to reset the timeout 2873 to the new value specified in the timeout header. Notice that the 2874 client asked for an infinite time out but the server choose to ignore 2875 the request. In this example, the nonce, response, and opaque fields 2876 have not been calculated in the Authorization request header. 2878 8.11.8. Example - Multi-Resource Lock Request 2880 >>Request 2882 LOCK /webdav/ HTTP/1.1 2883 Host: example.com 2884 Timeout: Infinite, Second-4100000000 2885 Depth: infinity 2886 Content-Type: application/xml; charset="utf-8" 2887 Content-Length: xxxx 2888 Authorization: Digest username="ejw", 2889 realm="ejw@example.com", nonce="...", 2890 uri="/workspace/webdav/proposal.doc", 2891 response="...", opaque="..." 2893 2894 2895 2896 2897 2898 http://www.ics.uci.edu/~ejw/contact.html 2899 2900 2902 >>Response 2904 HTTP/1.1 207 Multi-Status 2905 Content-Type: application/xml; charset="utf-8" 2906 Content-Length: xxxx 2908 2909 2910 2911 http://example.com/webdav/secret 2912 HTTP/1.1 403 Forbidden 2913 2914 2915 http://example.com/webdav/ 2916 HTTP/1.1 424 Failed Dependency 2917 2918 2920 This example shows a request for an exclusive write lock on a 2921 collection and all its children. In this request, the client has 2922 specified that it desires an infinite length lock, if available, 2923 otherwise a timeout of 4.1 billion seconds, if available. The 2924 request entity body contains the contact information for the 2925 principal taking out the lock, in this case a web page URL. 2927 The error is a 403 (Forbidden) response on the resource 2928 http://example.com/webdav/secret. Because this resource could not be 2929 locked, none of the resources were locked. Note also that the a 2930 'response' element for the Request-URI itself has been included as 2931 required. 2933 In this example, the nonce, response, and opaque fields have not been 2934 calculated in the Authorization request header. 2936 8.12. UNLOCK Method 2938 The UNLOCK method removes the lock identified by the lock token in 2939 the Lock-Token request header. The Request-URI MUST identify a 2940 resource within the scope of the lock. 2942 Note that use of Lock-Token header to provide the lock token is not 2943 consistent with other state-changing methods which all require an If 2944 header with the lock token. Thus, the If header is not needed to 2945 provide the lock token. Naturally when the If header is present it 2946 has its normal meaning as a conditional header. 2948 For a successful response to this method, the server MUST remove the 2949 lock from the resource identified by the Request-URI and from all 2950 other resources included in the lock. 2952 If all resources which have been locked under the submitted lock 2953 token can not be unlocked then the UNLOCK request MUST fail. 2955 A successful response to an UNLOCK method does not mean that the 2956 resource is necessarily unlocked. It means that the specific lock 2957 corresponding to the specified token no longer exists. 2959 Any DAV compliant resource which supports the LOCK method MUST 2960 support the UNLOCK method. 2962 This method is idempotent, but not safe (see section 9.1 of 2963 [RFC2616]). Responses to this method MUST NOT be cached. 2965 8.12.1. Status Codes 2967 In addition to the general status codes possible, the following 2968 status codes have specific applicability to UNLOCK: 2970 204 (No Content) - Normal success response (rather than 200 OK, since 2971 200 OK would imply a response body, and an UNLOCK success response 2972 does not normally contain a body) 2973 400 (Bad Request) - No lock token was provided (see 'lock-token- 2974 present' precondition), or request was made to a Request-URI that was 2975 not within the scope of the lock (see 'lock-token-matches-request- 2976 uri' precondition). 2978 403 (Forbidden) - The currently authenticated principal does not have 2979 permission to remove the lock. 2981 409 (Conflict) - The resource was not locked and thus could not be 2982 unlocked. 2984 8.12.2. Example - UNLOCK 2986 >>Request 2988 UNLOCK /workspace/webdav/info.doc HTTP/1.1 2989 Host: example.com 2990 Lock-Token: 2991 Authorization: Digest username="ejw" 2992 realm="ejw@example.com", nonce="...", 2993 uri="/workspace/webdav/proposal.doc", 2994 response="...", opaque="..." 2996 >>Response 2998 HTTP/1.1 204 No Content 3000 In this example, the lock identified by the lock token 3001 "urn:uuid:a515cfa4-5da4-22e1-f5b5-00a0451e6bf7" is successfully 3002 removed from the resource 3003 http://example.com/workspace/webdav/info.doc. If this lock included 3004 more than just one resource, the lock is removed from all resources 3005 included in the lock. The 204 (No Content) status code is used 3006 instead of 200 (OK) because there is no response entity body. 3008 In this example, the nonce, response, and opaque fields have not been 3009 calculated in the Authorization request header. 3011 9. HTTP Headers for Distributed Authoring 3013 All DAV headers follow the same basic formatting rules as HTTP 3014 headers. This includes rules like line continuation and how to 3015 combine (or separate) multiple instances of the same header using 3016 commas. WebDAV adds two new conditional headers to the set defined 3017 in HTTP: the If and Overwrite headers. 3019 9.1. DAV Header 3021 DAV = "DAV" ":" #( compliance-class ) 3022 compliance-class = ( "1" | "2" | "bis" | extend ) 3023 extend = Coded-URL | token 3024 Coded-URL = "<" absolute-URI ">" 3025 ; No LWS allowed in Coded-URL 3026 ; absolute-URI is defined in RFC3986 3028 This general-header appearing in the response indicates that the 3029 resource supports the DAV schema and protocol as specified. All DAV 3030 compliant resources MUST return the DAV header with compliance-class 3031 "1" on all OPTIONS responses. In cases where WebDAV is only 3032 supported in part of the server namespace, an OPTIONS request to non- 3033 WebDAV resources (including "/") SHOULD NOT advertise WebDAV support. 3035 The value is a comma-separated list of all compliance class 3036 identifiers that the resource supports. Class identifiers may be 3037 Coded-URLs or tokens (as defined by [RFC2616]). Identifiers can 3038 appear in any order. Identifiers that are standardized through the 3039 IETF RFC process are tokens, but other identifiers SHOULD be Coded- 3040 URLs to encourage uniqueness. 3042 A resource must show class 1 compliance if it shows class 2 or "bis" 3043 compliance. In general, support for one compliance class does not 3044 entail support for any other. Please refer to Section 17 for more 3045 details on compliance classes defined in this specification. 3047 Note that many WebDAV servers do not advertise WebDAV support in 3048 response to "OPTIONS *". 3050 As a request header, this header allows the client to advertise 3051 compliance with named features when the server needs that 3052 information. Clients SHOULD NOT send this header unless a standards 3053 track specification requires it. Any extension that makes use of 3054 this as a request header will need to carefully consider caching 3055 implications. 3057 9.2. Depth Header 3058 Depth = "Depth" ":" ("0" | "1" | "infinity") 3060 The Depth request header is used with methods executed on resources 3061 which could potentially have internal members to indicate whether the 3062 method is to be applied only to the resource ("Depth: 0"), to the 3063 resource and its immediate children, ("Depth: 1"), or the resource 3064 and all its progeny ("Depth: infinity"). 3066 The Depth header is only supported if a method's definition 3067 explicitly provides for such support. 3069 The following rules are the default behavior for any method that 3070 supports the Depth header. A method may override these defaults by 3071 defining different behavior in its definition. 3073 Methods which support the Depth header may choose not to support all 3074 of the header's values and may define, on a case by case basis, the 3075 behavior of the method if a Depth header is not present. For 3076 example, the MOVE method only supports "Depth: infinity" and if a 3077 Depth header is not present will act as if a "Depth: infinity" header 3078 had been applied. 3080 Clients MUST NOT rely upon methods executing on members of their 3081 hierarchies in any particular order or on the execution being atomic 3082 unless the particular method explicitly provides such guarantees. 3084 Upon execution, a method with a Depth header will perform as much of 3085 its assigned task as possible and then return a response specifying 3086 what it was able to accomplish and what it failed to do. 3088 So, for example, an attempt to COPY a hierarchy may result in some of 3089 the members being copied and some not. 3091 By default, the Depth header does not interact with other headers. 3092 That is, each header on a request with a Depth header MUST be applied 3093 only to the Request-URI if it applies to any resource, unless 3094 specific Depth behavior is defined for that header. 3096 If a resource, source or destination, within the scope of the method 3097 with a Depth header is locked in such a way as to prevent the 3098 successful execution of the method, then the lock token for that 3099 resource MUST be submitted with the request in the If request header. 3101 The Depth header only specifies the behavior of the method with 3102 regards to internal children. If a resource does not have internal 3103 children then the Depth header MUST be ignored. 3105 Please note, however, that it is always an error to submit a value 3106 for the Depth header that is not allowed by the method's definition. 3107 Thus submitting a "Depth: 1" on a COPY, even if the resource does not 3108 have internal members, will result in a 400 (Bad Request). The 3109 method should fail not because the resource doesn't have internal 3110 members, but because of the illegal value in the header. 3112 9.3. Destination Header 3114 Destination = "Destination" ":" ( absolute-URI ) 3116 The Destination request header specifies the URI which identifies a 3117 destination resource for methods such as COPY and MOVE, which take 3118 two URIs as parameters. Note that the absolute-URI production is 3119 defined in [RFC3986]. 3121 Since the Destination value is an absolute URI, it may name a 3122 different server (or different port or scheme). If the source server 3123 cannot attempt a copy to the remote server, it MUST fail the request 3124 with a 502 (Bad Gateway) response. 3126 If the Destination value is too long or otherwise unacceptable, the 3127 server SHOULD return 400 (Bad Request), ideally with helpful 3128 information in an error body. 3130 9.4. If Header 3132 If = "If" ":" ( 1*No-tag-list | 1*Tagged-list) 3133 No-tag-list = List 3134 Tagged-list = Resource 1*List 3135 Resource = Coded-URL 3136 List = "(" 1*(["Not"](State-token | "[" entity-tag "]")) ")" 3137 ; No LWS allowed between "[", entity-tag and "]" 3138 State-token = Coded-URL 3140 The If request header is intended to have similar functionality to 3141 the If-Match header defined in section 14.24 of [RFC2616]. However 3142 the If header is intended for use with any URI which represents state 3143 information, referred to as a state token, about a resource as well 3144 as ETags. A typical example of a state token is a lock token, and 3145 lock tokens are the only state tokens defined in this specification. 3146 The state token is an example of a state token that 3147 will never match an actual valid lock token (not that it's special in 3148 this regard). The purpose of this is described in Section 9.4.4. 3150 The If header's purpose is to describe a series of state lists. If 3151 the state of the resource to which the header is applied does not 3152 match any of the specified state lists then the request MUST fail 3153 with a 412 (Precondition Failed). If one of the described state 3154 lists matches the state of the resource then the request may succeed. 3156 The server MUST do authorization checks before checking this or any 3157 conditional header. Assuming no other errors, the server MUST parse 3158 the If header when it appears on any request, evaluate all the 3159 clauses, and if the conditional evaluates to false, fail as described 3160 above. 3162 9.4.1. No-tag-list Production 3164 The No-tag-list production describes a series of state tokens and 3165 ETags. If multiple No-tag-list productions are used then one only 3166 needs to match the state of the resource for the method to be allowed 3167 to continue. All untagged tokens apply to the resource identified in 3168 the Request-URI. 3170 Example - no-tag-list production 3172 If: ( 3173 ["I am an ETag"]) (["I am another ETag"]) 3175 The previous header would require that the resource identified in the 3176 Request-URI be locked with the specified lock token and in the state 3177 identified by the "I am an ETag" ETag or in the state identified by 3178 the second ETag "I am another ETag". To put the matter more plainly 3179 one can think of the previous If header as being in the form (or (and 3180 ["I am an ETag"]) 3181 (and ["I am another ETag"])). 3183 9.4.2. Tagged-list Production 3185 The tagged-list production may be used instead of the no-tag-list 3186 production, in order to scope each token to a specific resource. 3187 That is, it specifies that the lists following the resource 3188 specification only apply to the specified resource. The scope of the 3189 resource production begins with the list production immediately 3190 following the resource production and ends with the next resource 3191 production, if any. All clauses must be evaluated. If the state of 3192 the resource named in the tag does not match any of the associated 3193 state lists then the request MUST fail with a 412 (Precondition 3194 Failed). 3196 The same URI MUST NOT appear more than once in a resource production 3197 in an If header. 3199 9.4.3. Example - Tagged List If header in COPY 3201 >>Request 3203 COPY /resource1 HTTP/1.1 3204 Host: www.example.com 3205 Destination: http://www.example.com/resource2 3206 If: 3207 ( 3208 [W/"A weak ETag"]) (["strong ETag"]) 3209 3210 (["another strong ETag"]) 3212 In this example http://www.example.com/resource1 is being copied to 3213 http://www.example.com/resource2. When the method is first applied 3214 to http://www.example.com/resource1, resource1 must be in the state 3215 specified by "( [W/"A 3216 weak ETag"]) (["strong ETag"])", that is, it either must be locked 3217 with a lock token of "urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2" 3218 and have a weak entity tag W/"A weak ETag" or it must have a strong 3219 entity tag "strong ETag". 3221 That is the only success condition since the resource 3222 http://www.example.com/random never has the method applied to it (the 3223 only other resource listed in the If header) and 3224 http://www.example.com/resource2 is not listed in the If header. 3226 9.4.4. Not Production 3228 Every state token or ETag is either current, and hence describes the 3229 state of a resource, or is not current, and does not describe the 3230 state of a resource. The boolean operation of matching a state token 3231 or ETag to the current state of a resource thus resolves to a true or 3232 false value. The "Not" production is used to reverse that value. 3233 The scope of the not production is the state-token or entity-tag 3234 immediately following it. 3236 If: (Not 3237 ) 3239 When submitted with a request, this If header requires that all 3240 operand resources must not be locked with 3241 urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2 and must be locked with 3242 urn:uuid:58f202ac-22cf-11d1-b12d-002035b29092. 3244 The Not production is particularly useful with a state token known 3245 not to ever identify a lock, such as the "" state token. 3246 The clause "Not " MUST evaluate to true. Thus, any "OR" 3247 statement containing the clause "Not " MUST also 3248 evaluate to true. 3250 9.4.5. Matching Function 3252 When performing If header processing, the definition of a matching 3253 state token or entity tag is as follows. 3255 Identifying a resource: The resource is identified by the URI along 3256 with the token, in tagged list production, or by the Request-URI in 3257 untagged list production. 3259 Matching entity tag: Where the entity tag matches an entity tag 3260 associated with the identified resource. 3262 Matching state token: Where there is an exact match between the state 3263 token in the If header and any state token on the identified 3264 resource. A lock state token is considered to match if the resource 3265 is anywhere in the scope of the lock. 3267 Example - Matching lock tokens with collection locks 3269 DELETE /specs/rfc2518.txt HTTP/1.1 3270 Host: www.example.com 3271 If: 3272 () 3274 For this example, the lock token must be compared to the identified 3275 resource, which is the 'specs' collection identified by the URL in 3276 the tagged list production. If the 'specs' collection is not locked 3277 or has a lock with a different token, the request MUST fail. If the 3278 'specs' collection is locked (depth infinity) with that lock token, 3279 then this request could succeed, both because the If header evaluates 3280 to true, and because the lock token for the lock affecting the 3281 affected resource has been provided. Alternatively, a request where 3282 the 'rfc2518.txt' URL is associated with the lock token in the If 3283 header could also succeed. 3285 9.4.6. If Header and Non-DAV Aware Proxies 3287 Non-DAV aware proxies will not honor the If header, since they will 3288 not understand the If header, and HTTP requires non-understood 3289 headers to be ignored. When communicating with HTTP/1.1 proxies, the 3290 "Cache-Control: no-cache" request header MUST be used so as to 3291 prevent the proxy from improperly trying to service the request from 3292 its cache. When dealing with HTTP/1.0 proxies the "Pragma: no-cache" 3293 request header MUST be used for the same reason. 3295 9.5. Lock-Token Header 3297 Lock-Token = "Lock-Token" ":" Coded-URL 3299 The Lock-Token request header is used with the UNLOCK method to 3300 identify the lock to be removed. The lock token in the Lock-Token 3301 request header MUST identify a lock that contains the resource 3302 identified by Request-URI as a member. 3304 The Lock-Token response header is used with the LOCK method to 3305 indicate the lock token created as a result of a successful LOCK 3306 request to create a new lock. 3308 9.6. Overwrite Header 3310 Overwrite = "Overwrite" ":" ("T" | "F") 3312 The Overwrite request header specifies whether the server should 3313 overwrite a resource mapped to the destination URL during a COPY or 3314 MOVE. A value of "F" states that the server must not perform the 3315 COPY or MOVE operation if the state of the destination URL does map 3316 to a resource. If the overwrite header is not included in a COPY or 3317 MOVE request then the resource MUST treat the request as if it has an 3318 overwrite header of value "T". While the Overwrite header appears to 3319 duplicate the functionality of the If-Match: * header of HTTP/1.1, 3320 If-Match applies only to the Request-URI, and not to the Destination 3321 of a COPY or MOVE. 3323 If a COPY or MOVE is not performed due to the value of the Overwrite 3324 header, the method MUST fail with a 412 (Precondition Failed) status 3325 code. The server MUST do authorization checks before checking this 3326 or any conditional header. 3328 All DAV compliant resources MUST support the Overwrite header. 3330 9.7. Timeout Request Header 3332 TimeOut = "Timeout" ":" 1#TimeType 3333 TimeType = ("Second-" DAVTimeOutVal | "Infinite") 3334 ; No LWS allowed within TimeType 3335 DAVTimeOutVal = 1*DIGIT 3337 Clients may include Timeout request headers in their LOCK requests. 3338 However, the server is not required to honor or even consider these 3339 requests. Clients MUST NOT submit a Timeout request header with any 3340 method other than a LOCK method. 3342 Timeout response values MUST use a Second value or Infinite. 3344 The "Second" TimeType specifies the number of seconds that will 3345 elapse between granting of the lock at the server, and the automatic 3346 removal of the lock. The timeout value for TimeType "Second" MUST 3347 NOT be greater than 2^32-1. 3349 The timeout counter MUST be restarted if a refresh LOCK request is 3350 successful. The timeout counter SHOULD NOT be restarted at any other 3351 time. 3353 If the timeout expires then the lock may be lost. Specifically, if 3354 the server wishes to harvest the lock upon time-out, the server 3355 SHOULD act as if an UNLOCK method was executed by the server on the 3356 resource using the lock token of the timed-out lock, performed with 3357 its override authority. Thus logs should be updated with the 3358 disposition of the lock, notifications should be sent, etc., just as 3359 they would be for an UNLOCK request. 3361 Servers are advised to pay close attention to the values submitted by 3362 clients, as they will be indicative of the type of activity the 3363 client intends to perform. For example, an applet running in a 3364 browser may need to lock a resource, but because of the instability 3365 of the environment within which the applet is running, the applet may 3366 be turned off without warning. As a result, the applet is likely to 3367 ask for a relatively small timeout value so that if the applet dies, 3368 the lock can be quickly harvested. However, a document management 3369 system is likely to ask for an extremely long timeout because its 3370 user may be planning on going off-line. 3372 A client MUST NOT assume that just because the time-out has expired 3373 the lock has been lost. Likewise, a client MUST NOT assume that just 3374 because the time-out has not expired, the lock still exists (and for 3375 this reason, clients are strongly advised to use ETags as well). 3377 10. Status Code Extensions to HTTP/1.1 3379 The following status codes are added to those defined in HTTP/1.1 3380 [RFC2616]. 3382 10.1. 207 Multi-Status 3384 The 207 (Multi-Status) status code provides status for multiple 3385 independent operations (see Section 12 for more information). 3387 10.2. 422 Unprocessable Entity 3389 The 422 (Unprocessable Entity) status code means the server 3390 understands the content type of the request entity (hence a 3391 415(Unsupported Media Type) status code is inappropriate), and the 3392 syntax of the request entity is correct (thus a 400 (Bad Request) 3393 status code is inappropriate) but was unable to process the contained 3394 instructions. For example, this error condition may occur if an XML 3395 request body contains well-formed (i.e., syntactically correct), but 3396 semantically erroneous XML instructions. 3398 10.3. 423 Locked 3400 The 423 (Locked) status code means the source or destination resource 3401 of a method is locked. This response SHOULD contain an appropriate 3402 precondition or postcondition code, such as 'lock-token-present' or 3403 'no-conflicting-lock". 3405 10.4. 424 Failed Dependency 3407 The 424 (Failed Dependency) status code means that the method could 3408 not be performed on the resource because the requested action 3409 depended on another action and that action failed. For example, if a 3410 command in a PROPPATCH method fails then, at minimum, the rest of the 3411 commands will also fail with 424 (Failed Dependency). 3413 10.5. 507 Insufficient Storage 3415 The 507 (Insufficient Storage) status code means the method could not 3416 be performed on the resource because the server is unable to store 3417 the representation needed to successfully complete the request. This 3418 condition is considered to be temporary. If the request which 3419 received this status code was the result of a user action, the 3420 request MUST NOT be repeated until it is requested by a separate user 3421 action. 3423 11. Use of HTTP Status Codes 3425 These HTTP codes are not redefined, but their use is somewhat 3426 extended by WebDAV methods and requirements. In general, many HTTP 3427 status codes can be used in response to any request, not just in 3428 cases described in this document. Note also that WebDAV servers are 3429 known to use 300-level redirect responses (and early interoperability 3430 tests found clients unprepared to see those responses). A 300-level 3431 request MUST NOT be used when the server has created a new resource 3432 in response to the request. 3434 11.1. 412 Precondition Failed 3436 Any request can contain a conditional header defined in HTTP (If- 3437 Match, If-Modified-Since, etc.) or the "If" or "Overwrite" 3438 conditional headers defined in this specification. If the server 3439 evaluates a conditional header, and if that condition fails to hold, 3440 then this error code MUST be returned. On the other hand, if the 3441 client did not include a conditional header in the request, then the 3442 server MUST NOT use this error. 3444 11.2. 414 Request-URI Too Long 3446 This status code is used in HTTP 1.1 only for Request-URIs, not URIs 3447 in other locations. 3449 12. Multi-Status Response 3451 A Multi-Status response contains one 'response' element for each 3452 resource in the scope of the request (in no required order) or MAY be 3453 empty if no resources match the request. The default 207 (Multi- 3454 Status) response body is a text/xml or application/xml HTTP entity 3455 that contains a single XML element called 'multistatus', which 3456 contains a set of XML elements called response which contain 200, 3457 300, 400, and 500 series status codes generated during the method 3458 invocation. 100 series status codes SHOULD NOT be recorded in a 3459 'response' XML element. The 207 status code itself MUST NOT be 3460 considered a success response, it is only completely successful if 3461 all 'response' elements inside contain success status codes. 3463 The body of a 207 Multi-Status response MUST contain a URL associated 3464 with each specific status code, so that the client can tell whether 3465 the error occurred with the source resource, destination resource or 3466 some other resource in the scope of the request. 3468 12.1. Response headers 3470 HTTP defines the Location header to indicate a preferred URL for the 3471 resource that was addressed in the Request-URI (e.g. in response to 3472 successful PUT requests or in redirect responses). However, use of 3473 this header creates ambiguity when there are URLs in the body of the 3474 response, as with Multi-Status. Thus, use of the Location header 3475 with the Multi-Status response is intentionally undefined. 3477 12.2. URL Handling 3479 A Multi-Status body contains one or more 'response' elements. Each 3480 response element describes a resource, and has an 'href' element 3481 identifying the resource. The 'href' element MUST contain an 3482 absolute URI or relative reference. It MUST NOT include "." or ".." 3483 as path elements. 3485 If a 'href' element contains a relative reference, it MUST be 3486 resolved against the Request-URI. A relative reference MUST be an 3487 absolute path (note that clients are not known to support relative 3488 paths). 3490 Identifiers for collections appearing in the results SHOULD end in a 3491 '/' character. 3493 If a server allows resource names to include characters that aren't 3494 legal in HTTP URL paths, these characters must be percent-encoded on 3495 the wire (see [RFC3986], section 2.1). For example, it is illegal to 3496 use a space character or double-quote in a URI. URIs appearing in 3497 PROPFIND or PROPPATCH XML bodies (or other XML marshalling defined in 3498 this specification) are still subject to all URI rules, including 3499 forbidden characters. 3501 12.3. Handling redirected child resources 3503 Redirect responses (300-303, 305 and 307) defined in HTTP 1.1 3504 normally take a Location header to indicate the new URI for the 3505 single resource redirected from the Request-URI. Multi-Status 3506 responses contain many resource addresses, but the original 3507 definition in RFC2518 did not have any place for the server to 3508 provide the new URI for redirected resources. This specification 3509 does define a 'location' element for this information (see 3510 Section 13.9). Servers MUST use this new element with redirect 3511 responses in Multi-Status. 3513 Clients encountering redirected resources in Multi-Status MUST NOT 3514 rely on the 'location' element being present with a new URI. If the 3515 element is not present, the client MAY reissue the request to the 3516 individual redirected resource, because the response to that request 3517 can be redirected with a Location header containing the new URI. 3519 12.4. Internal Status Codes 3521 Section 8.3.1, Section 8.2.2, Section 8.7.1, Section 8.9.3 and 3522 Section 8.10.2 define various status codes used in Multi-Status 3523 responses. This specification does not define the meaning of other 3524 status codes that could appear in these responses. 3526 13. XML Element Definitions 3528 In this section, the final line of each section gives the element 3529 type declaration using the format defined in [XML]. The "Value" 3530 field, where present, specifies further restrictions on the allowable 3531 contents of the XML element using BNF (i.e., to further restrict the 3532 values of a PCDATA element). The "Extensibility" field discusses how 3533 the element may be extended in the future (or in existing extensions 3534 to WebDAV. 3536 All of the elements defined here may be extended by the addition of 3537 attributes and child elements not defined in this specification. All 3538 elements defined here are in the "DAV:" namespace. 3540 13.1. activelock XML Element 3542 Name: activelock 3544 Purpose: Describes a lock on a resource. 3546 3549 13.2. allprop XML Element 3551 Name: allprop 3553 Purpose: Specifies that all names and values of dead properties and 3554 the live properties defined by this document existing on the 3555 resource are to be returned. 3557 3559 13.3. collection XML Element 3561 Name: collection 3563 Purpose: Identifies the associated resource as a collection. The 3564 DAV:resourcetype property of a collection resource MUST contain 3565 this element. It is normally empty but extensions may add sub- 3566 elements. 3568 3570 13.4. depth XML Element 3572 Name: depth 3574 Purpose: The value of the Depth header. 3576 Value: "0" | "1" | "infinity" 3578 3580 13.5. error XML Element 3582 Name: error 3584 Purpose: Error responses, particularly 403 Forbidden and 409 3585 Conflict, sometimes need more information to indicate what went 3586 wrong. When an error response contains a body in WebDAV, the body 3587 is in XML with the root element 'error'. The 'error' element 3588 SHOULD include an XML element with the code of a failed 3589 precondition or postcondition. 3591 Description: Contains at least one XML element, and MUST NOT contain 3592 text or mixed content. Any element that is a child of the 'error' 3593 element is considered to be a precondition or postcondition code. 3594 Unrecognized elements SHOULD be ignored if not recognized. 3596 3598 13.6. exclusive XML Element 3600 Name: exclusive 3602 Purpose: Specifies an exclusive lock 3604 3606 13.7. href XML Element 3608 Name: href 3610 Purpose: Identifies the content of the element as a URI or a 3611 relative reference. There may be limits on the value of 'href' 3612 depending on the context of its use. Refer to the specification 3613 text where 'href' is used to see what limitations apply in each 3614 case. 3616 Value: URI-reference (See section 4.1 of [RFC3986]) 3618 3620 13.8. include XML Element 3622 Name: include 3624 Purpose: Any child element represents the name of a property to be 3625 included in the PROPFIND response. All elements inside an 3626 'include' XML element MUST define properties related to the 3627 resource, although possible property names are in no way limited 3628 to those property names defined in this document or other 3629 standards. This element MUST NOT contain text or mixed content. 3631 3633 13.9. location XML Element 3635 Name: location 3637 Purpose: HTTP defines the "Location" header (see [RFC2616], section 3638 14.30) for use with some status codes (such as 201 and the 300 3639 series codes). When these codes are used inside a 'multistatus' 3640 element, the 'location' element can be used to provide the 3641 accompanying Location header value. 3643 Description: Contains a single href element with the same value that 3644 would be used in a Location header. 3646 3648 13.10. lockentry XML Element 3650 Name: lockentry 3652 Purpose: Defines the types of locks that can be used with the 3653 resource. 3655 3657 13.11. lockinfo XML Element 3658 Name: lockinfo 3660 Purpose: The 'lockinfo' XML element is used with a LOCK method to 3661 specify the type of lock the client wishes to have created. 3663 3665 13.12. lockroot XML Element 3667 Name: lockroot 3669 Purpose: Contains the root URL of the lock, which is the URL through 3670 which the resource was addressed in the LOCK request. 3672 Description: The href contains a HTTP URL with the address of the 3673 root of the lock. The server SHOULD include this in all DAV: 3674 lockdiscovery property values and the response to LOCK requests. 3676 3678 13.13. lockscope XML Element 3680 Name: lockscope 3682 Purpose: Specifies whether a lock is an exclusive lock, or a shared 3683 lock. 3685 3687 13.14. locktoken XML Element 3689 Name: locktoken 3691 Purpose: The lock token associated with a lock. 3693 Description: The href contains a single lock token URI which refers 3694 to the lock. 3696 3698 13.15. locktype XML Element 3699 Name: locktype 3701 Purpose: Specifies the access type of a lock. At present, this 3702 specification only defines one lock type, the write lock. 3704 3706 13.16. multistatus XML Element 3708 Name: multistatus 3710 Purpose: Contains multiple response messages. 3712 Description: The 'responsedescription' element at the top level is 3713 used to provide a general message describing the overarching 3714 nature of the response. If this value is available an application 3715 may use it instead of presenting the individual response 3716 descriptions contained within the responses. 3718 3720 13.17. prop XML element 3722 Name: prop 3724 Purpose: Contains properties related to a resource. 3726 Description: A generic container for properties defined on 3727 resources. All elements inside a 'prop' XML element MUST define 3728 properties related to the resource, although possible property 3729 names are in no way limited to those property names defined in 3730 this document or other standards. This element MUST NOT contain 3731 text or mixed content. 3733 3735 13.18. propertyupdate XML element 3737 Name: propertyupdate 3739 Purpose: Contains a request to alter the properties on a resource. 3741 Description: This XML element is a container for the information 3742 required to modify the properties on the resource. This XML 3743 element is multi-valued. 3745 3747 13.19. propfind XML Element 3749 Name: propfind 3751 Purpose: Specifies the properties to be returned from a PROPFIND 3752 method. Four special elements are specified for use with 3753 'propfind': 'prop', 'allprop', 'include' and 'propname'. If 3754 'prop' is used inside 'propfind' it MUST NOT contain property 3755 values. 3757 3759 13.20. propname XML Element 3761 Name: propname 3763 Purpose: Specifies that only a list of property names on the 3764 resource is to be returned. 3766 3768 13.21. propstat XML Element 3770 Name: propstat 3772 Purpose: Groups together a prop and status element that is 3773 associated with a particular 'href' element. 3775 Description: The propstat XML element MUST contain one prop XML 3776 element and one status XML element. The contents of the prop XML 3777 element MUST only list the names of properties to which the result 3778 in the status element applies. 3780 3782 13.22. remove XML element 3784 Name: remove 3785 Purpose: Lists the DAV properties to be removed from a resource. 3787 Description: Remove instructs that the properties specified in prop 3788 should be removed. Specifying the removal of a property that does 3789 not exist is not an error. All the XML elements in a 'prop' XML 3790 element inside of a 'remove' XML element MUST be empty, as only 3791 the names of properties to be removed are required. 3793 3795 13.23. response XML Element 3797 Name: response 3799 Purpose: Holds a single response describing the effect of a method 3800 on resource and/or its properties. 3802 Description: The 'href' element contains a HTTP URL pointing to a 3803 WebDAV resource when used in the 'response' container. A 3804 particular 'href' value MUST NOT appear more than once as the 3805 child of a 'response' XML element under a 'multistatus' XML 3806 element. This requirement is necessary in order to keep 3807 processing costs for a response to linear time. Essentially, this 3808 prevents having to search in order to group together all the 3809 responses by 'href'. There are, however, no requirements 3810 regarding ordering based on 'href' values. 3812 3815 13.24. responsedescription XML Element 3817 Name: responsedescription 3819 Purpose: Contains information about a status response within a 3820 Multi-Status. 3822 Description: Provides information suitable to be presented to a user 3823 (PCDATA) and/or condition name elements (in 'error'). 3825 3827 13.25. set XML element 3828 Name: set 3830 Purpose: Lists the DAV property values to be set for a resource. 3832 Description: The 'set' XML element MUST contain only a prop XML 3833 element. The elements contained by the prop XML element inside 3834 the 'set' XML element MUST specify the name and value of 3835 properties that are set on the resource identified by Request-URI. 3836 If a property already exists then its value is replaced. Language 3837 tagging information appearing in the scope of the 'prop' element 3838 (in the "xml:lang" attribute, if present) MUST be persistently 3839 stored along with the property, and MUST be subsequently 3840 retrievable using PROPFIND. 3842 3844 13.26. shared XML Element 3846 Name: shared 3848 Purpose: Specifies a shared lock 3850 3852 13.27. status XML Element 3854 Name: status 3856 Purpose: Holds a single HTTP status-line 3858 Value: status-line (status-line defined in Section 6.1 of [RFC2616]) 3860 3862 13.28. timeout XML Element 3864 Name: timeout 3866 Purpose: The number of seconds remaining before a lock expires. 3868 Value: TimeType (defined in Section 9.7). 3870 3872 13.29. write XML Element 3874 Name: write 3876 Purpose: Specifies a write lock. 3878 3880 14. DAV Properties 3882 For DAV properties, the name of the property is also the same as the 3883 name of the XML element that contains its value. In the section 3884 below, the final line of each section gives the element type 3885 declaration using the format defined in [XML]. The "Value" field, 3886 where present, specifies further restrictions on the allowable 3887 contents of the XML element using BNF (i.e., to further restrict the 3888 values of a PCDATA element). Note that a resource may have only one 3889 value for a property of a given name, so the property may only show 3890 up once in PROPFIND responses. 3892 A protected property is one which cannot be changed with a PROPPATCH 3893 request. There may be other requests which would result in a change 3894 to a protected property (as when a LOCK request affects the value of 3895 DAV:lockdiscovery). Note that a given property could be protected on 3896 one type of resource, but not protected on another type of resource. 3898 A computed property is one with a value defined in terms of a 3899 computation (based on the content and other properties of that 3900 resource, or even of some other resource). A computed property is 3901 always a protected property. 3903 COPY and MOVE behavior refers to local COPY and MOVE operations. 3905 For properties defined based on HTTP GET response headers (DAV:get*), 3906 the value could include LWS as defined in [RFC2616], section 4.2. 3907 Server implementors SHOULD NOT include extra LWS in these values, 3908 however client implementors MUST be prepared to handle extra LWS. 3910 14.1. creationdate Property 3912 Name: creationdate 3914 Purpose: Records the time and date the resource was created. 3916 Value: date-time (defined in [RFC3339], see the ABNF in section 3917 5.6.) 3919 Protected: MAY be protected. Some servers allow DAV:creationdate to 3920 be changed to reflect the time the document was created if that is 3921 more meaningful to the user (rather than the time it was 3922 uploaded). Thus, clients SHOULD NOT use this property in 3923 synchronization logic (use DAV:getetag instead). 3925 COPY/MOVE behaviour: This property value SHOULD be kept during a 3926 MOVE operation, but is normally re-initialized when a resource is 3927 created with a COPY. It should not be set in a COPY. 3929 Description: The DAV:creationdate property SHOULD be defined on all 3930 DAV compliant resources. If present, it contains a timestamp of 3931 the moment when the resource was created. Servers that are 3932 incapable of persistently recording the creation date SHOULD 3933 instead leave it undefined (i.e. report "Not Found") 3935 3937 14.2. displayname Property 3939 Name: displayname 3941 Purpose: Provides a name for the resource that is suitable for 3942 presentation to a user. 3944 Value: Any text 3946 Protected: SHOULD NOT be protected. Note that servers implementing 3947 RFC2518 might have made this a protected property as this is a new 3948 requirement. 3950 COPY/MOVE behaviour: This property value SHOULD be preserved in COPY 3951 and MOVE operations. 3953 Description: The DAV:displayname property should be defined on all 3954 DAV compliant resources. If present, the property contains a 3955 description of the resource that is suitable for presentation to a 3956 user. This property is defined on the resource, and hence SHOULD 3957 have the same value independent of the Request-URI used to 3958 retrieve it (thus computing this property based on the Request-URI 3959 is deprecated). 3961 3963 14.3. getcontentlanguage Property 3965 Name: getcontentlanguage 3967 Purpose: Contains the Content-Language header value (from section 3968 14.12 of [RFC2616]) as it would be returned by a GET without 3969 accept headers. 3971 Value: language-tag (language-tag is defined in section 3.10 of 3972 [RFC2616]). 3974 Protected: SHOULD NOT be protected, so that clients can reset the 3975 language. Note that servers implementing RFC2518 might have made 3976 this a protected property as this is a new requirement. 3978 COPY/MOVE behaviour: This property value SHOULD be preserved in COPY 3979 and MOVE operations. 3981 Description: The DAV:getcontentlanguage property MUST be defined on 3982 any DAV compliant resource that returns the Content-Language 3983 header on a GET. 3985 3987 14.4. getcontentlength Property 3989 Name: getcontentlength 3991 Purpose: Contains the Content-Length header returned by a GET 3992 without accept headers. 3994 Value: See section 14.13 of [RFC2616]. 3996 Protected: This property is computed, therefore protected. 3998 Description: The DAV:getcontentlength property MUST be defined on 3999 any DAV compliant resource that returns the Content-Length header 4000 in response to a GET. 4002 COPY/MOVE behaviour: This property value is dependent on the size of 4003 the destination resource, not the value of the property on the 4004 source resource. 4006 4008 14.5. getcontenttype Property 4010 Name: getcontenttype 4012 Purpose: Contains the Content-Type header value (from section 14.17 4013 of [RFC2616]) as it would be returned by a GET without accept 4014 headers. 4016 Value: media-type (defined in section 3.7 of [RFC2616]) 4018 Protected: SHOULD NOT be protected, so clients may fix this value. 4019 Note that servers implementing RFC2518 might have made this a 4020 protected property as this is a new requirement. 4022 COPY/MOVE behaviour: This property value SHOULD be preserved in COPY 4023 and MOVE operations. 4025 Description: This property MUST be defined on any DAV compliant 4026 resource that returns the Content-Type header in response to a 4027 GET. 4029 4031 14.6. getetag Property 4033 Name: getetag 4035 Purpose: Contains the ETag header value (from section 14.19 of 4036 [RFC2616]) as it would be returned by a GET without accept 4037 headers. 4039 Value: entity-tag (defined in section 3.11 of [RFC2616]) 4041 Protected: MUST be protected because this value is created and 4042 controlled by the server. 4044 COPY/MOVE behaviour: This property value is dependent on the final 4045 state of the destination resource, not the value of the property 4046 on the source resource. Also note the considerations in 4047 Section 8.1.6. 4049 Description: The getetag property MUST be defined on any DAV 4050 compliant resource that returns the Etag header. Refer to RFC2616 4051 for a complete definition of the semantics of an ETag. Note that 4052 changes in properties or lock state MUST not cause a resource's 4053 ETag to change. 4055 4057 14.7. getlastmodified Property 4059 Name: getlastmodified 4060 Purpose: Contains the Last-Modified header value (from section 14.29 4061 of [RFC2616]) as it would be returned by a GET method without 4062 accept headers. 4064 Value: rfc1123-date (defined in section 3.3.1 of [RFC2616]) 4066 Protected: SHOULD be protected because some clients may rely on the 4067 value for appropriate caching behavior, or on the value of the 4068 Last-Modified header to which this property is linked. 4070 COPY/MOVE behaviour: This property value is dependent on the last 4071 modified date of the destination resource, not the value of the 4072 property on the source resource. Note that some server 4073 implementations use the file system date modified value for the 4074 DAV:getlastmodified value, and this can be preserved in a MOVE 4075 even when the HTTP Last-Modified value SHOULD change. Note that 4076 since [RFC2616] requires clients to use ETags where provided, a 4077 server implementing ETags can count on clients using a much better 4078 mechanism that modification dates for offline synchronization or 4079 cache control. Also note the considerations in Section 8.1.6. 4081 Description: Note that the last-modified date on a resource SHOULD 4082 only reflect changes in the body (the GET responses) of the 4083 resource. A change in a property only SHOULD NOT cause the last- 4084 modified date to change, because clients MAY rely on the last- 4085 modified date to know when to overwrite the existing body. The 4086 DAV:getlastmodified property MUST be defined on any DAV compliant 4087 resource that returns the Last-Modified header in response to a 4088 GET. 4090 4092 14.8. lockdiscovery Property 4094 Name: lockdiscovery 4096 Purpose: Describes the active locks on a resource 4098 Protected: MUST be protected. Clients change the list of locks 4099 through LOCK and UNLOCK, not through PROPPATCH. 4101 COPY/MOVE behaviour: The value of this property depends on the lock 4102 state of the destination, not on the locks of the source resource. 4103 Recall that locks are not moved in a MOVE operation. 4105 Description: Returns a listing of who has a lock, what type of lock 4106 he has, the timeout type and the time remaining on the timeout, 4107 and the associated lock token. If there are no locks, but the 4108 server supports locks, the property will be present but contain 4109 zero 'activelock' elements. If there is one or more lock, an 4110 'activelock' element appears for each lock on the resource. 4112 4114 14.8.1. Example - Retrieving DAV:lockdiscovery 4116 >>Request 4118 PROPFIND /container/ HTTP/1.1 4119 Host: www.example.com 4120 Content-Length: xxxx 4121 Content-Type: application/xml; charset="utf-8" 4123 4124 4125 4126 4128 >>Response 4130 HTTP/1.1 207 Multi-Status 4131 Content-Type: application/xml; charset="utf-8" 4132 Content-Length: xxxx 4134 4135 4136 4137 http://www.example.com/container/ 4138 4139 4140 4141 4142 4143 4144 0 4145 Jane Smith 4146 Infinite 4147 4148 urn:uuid:f81de2ad-7f3d-a1b2-4f3c-00a0c91a9d76 4150 4151 4152 http://www.example.com/container/ 4153 4154 4155 4156 4157 HTTP/1.1 200 OK 4158 4159 4160 4162 This resource has a single exclusive write lock on it, with an 4163 infinite timeout. 4165 14.9. resourcetype Property 4167 Name: resourcetype 4169 Purpose: Specifies the nature of the resource. 4171 Protected: SHOULD be protected. Resource type is generally decided 4172 through the operation creating the resource (MKCOL vs PUT), not by 4173 PROPPATCH. 4175 COPY/MOVE behaviour: Generally a COPY/MOVE of a resource results in 4176 the same type of resource at the destination. 4178 Description: MUST be defined on all DAV compliant resources. Each 4179 child element identifies a specific type the resource belongs to, 4180 such as 'collection', which is the only resource type defined by 4181 this specification (see Section 13.3). If the element contains 4182 the 'collection' child element plus additional unrecognized 4183 elements, it should generally be treated as a collection. If the 4184 element contains no recognized child elements, it should be 4185 treated as a non-collection resource. The default value is empty. 4186 This element MUST NOT contain text or mixed content. Any custom 4187 child element is considered to be an identifier for a resource 4188 type. 4190 Example: (fictional example to show extensibility) 4192 4193 4194 4195 4197 14.10. supportedlock Property 4199 Name: supportedlock 4201 Purpose: To provide a listing of the lock capabilities supported by 4202 the resource. 4204 Protected: MUST be protected. Servers determine what lock 4205 mechanisms are supported, not clients. 4207 COPY/MOVE behaviour: This property value is dependent on the kind of 4208 locks supported at the destination, not on the value of the 4209 property at the source resource. Servers attempting to COPY to a 4210 destination should not attempt to set this property at the 4211 destination. 4213 Description: Returns a listing of the combinations of scope and 4214 access types which may be specified in a lock request on the 4215 resource. Note that the actual contents are themselves controlled 4216 by access controls so a server is not required to provide 4217 information the client is not authorized to see. 4219 4221 14.10.1. Example - Retrieving DAV:supportedlock 4223 >>Request 4225 PROPFIND /container/ HTTP/1.1 4226 Host: www.example.com 4227 Content-Length: xxxx 4228 Content-Type: application/xml; charset="utf-8" 4230 4231 4232 4233 4235 >>Response 4237 HTTP/1.1 207 Multi-Status 4238 Content-Type: application/xml; charset="utf-8" 4239 Content-Length: xxxx 4241 4242 4243 4244 http://www.example.com/container/ 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 HTTP/1.1 200 OK 4259 4260 4261 4263 15. Precondition/postcondition XML elements 4265 As introduced in section Section 8.1.5, extra information on error 4266 conditions can be included in the body of many status responses. 4267 This section makes requirements on the use of the error body 4268 mechanism and introduces a number of precondition and postcondition 4269 codes. 4271 A "precondition" of a method describes the state of the server that 4272 must be true for that method to be performed. A "postcondition" of a 4273 method describes the state of the server that must be true after that 4274 method has been completed. 4276 Each precondition and postcondition has a unique XML element 4277 associated with it. In a 207 Multi-Status response, the XML element 4278 MUST appear inside a DAV:error element in the appropriate DAV: 4279 responsedescription element. In all other error responses, the XML 4280 element MUST be returned as the child of a top-level DAV:error 4281 element in the response body, unless otherwise negotiated by the 4282 request, along with an appropriate response status. The most common 4283 response status codes are 403 (Forbidden) if the request should not 4284 be repeated because it will always fail, and 409 (Conflict) if it is 4285 expected that the user might be able to resolve the conflict and 4286 resubmit the request. The DAV:error element MAY contain child 4287 elements with specific error information and MAY be extended with any 4288 custom child elements. 4290 This mechanism does not take the place of using a correct numeric 4291 error code as defined here or in HTTP, because the client MUST always 4292 be able to take a reasonable course of action based only on the 4293 numeric error. However, it does remove the need to define new 4294 numeric error codes. The machine-readable codes used for this 4295 purpose are XML elements classified as preconditions and 4296 postconditions, so naturally any group defining a new error code can 4297 use their own namespace. As always, the "DAV:" namespace is reserved 4298 for use by IETF-chartered WebDAV working groups. 4300 A server supporting "bis" SHOULD use the XML error whenever a 4301 precondition or postcondition defined in this document is violated. 4302 For error conditions not specified in this document, the server MAY 4303 simply choose an appropriate numeric status and leave the response 4304 body blank. However, a server MAY instead use a custom error code 4305 and other supporting text, because even when clients do not 4306 automatically recognize error codes they can be quite useful in 4307 interoperability testing and debugging. 4309 Example - Response with precondition code" 4310 >>Response 4312 HTTP/1.1 423 Locked 4313 Content-Type: application/xml; charset="utf-8" 4314 Content-Length: xxxx 4316 4317 4318 4319 /workspace/webdav/ 4320 4321 4323 In this example, a client unaware of a "Depth: infinity" lock on the 4324 parent collection "/workspace/webdav/" attempted to modify the 4325 collection member "/workspace/webdav/proposal.doc". 4327 Some other useful preconditions and postconditions have been defined 4328 in other specifications extending WebDAV, such as [RFC3744] (see 4329 particularly section 7.1.1), [RFC3253], and [RFC3648]. 4331 All these elements are in the "DAV:" namespace. 4333 Name: lock-token-matches-request-uri 4335 Use with: 400 Bad Request 4337 Purpose: (precondition) -- A request may include a Lock-Token header 4338 to identify a lock for the purposes of an operation such as 4339 refresh LOCK or UNLOCK. However, if the Request-URI doe not fall 4340 within the scope of the lock identified by the token, the server 4341 SHOULD use this error. The lock may have a scope that does not 4342 include the Request-URI, or the lock could have disappeared, or 4343 the token may be invalid. 4345 4347 Name: lock-token-submitted (precondition) 4349 Use with: 4xx responses, e.g. 400 Bad Request or 423 Locked 4351 Purpose: The request could not succeed because a lock token should 4352 have been submitted. This element, if present, MUST contain at 4353 least one URL of a locked resource that prevented the request. In 4354 cases of MOVE, COPY and DELETE where collection locks are 4355 involved, it can be difficult for the client to find out which 4356 locked resource made the request fail -- but the server is only 4357 resonsible for returning one such locked resource. The server MAY 4358 return every locked resource that prevented the request from 4359 succeeding if it knows them all. 4361 4363 Name: no-conflicting-lock (precondition) 4365 Use with: Typically 423 Locked 4367 Purpose: A LOCK request failed due the presence of an already 4368 existing conflicting lock. Note that a lock can be in conflict 4369 although the resource to which the request was directed is only 4370 indirectly locked. In this case, the precondition code can be 4371 used to inform the client about the resource which is the root of 4372 the conflicting lock, avoiding a separate lookup of the 4373 "lockdiscovery" property. 4375 4377 Name: no-external-entities 4379 Use with: 403 Forbidden 4381 Purpose: (precondition) -- If the server rejects a client request 4382 because the request body contains an external entity, the server 4383 SHOULD use this error. 4385 4387 Name: preserved-live-properties 4389 Use with: 409 Conflict 4391 Purpose: (postcondition) -- The server received an otherwise-valid 4392 MOVE or COPY request, but cannot maintain the live properties with 4393 the same behavior at the destination. It may be that the server 4394 only supports some live properties in some parts of the 4395 repository, or simply has an internal error. 4397 4399 Name: propfind-finite-depth 4401 Use with: 403 Forbidden 4402 Purpose: (precondition) -- This server does not allow infinite-depth 4403 PROPFIND requests on collections. 4405 4407 Name: writable-property 4409 Use with: 403 Forbidden 4411 Purpose: (precondition) -- The client attempted to set a read-only 4412 property in a PROPPATCH (such as DAV:getetag). 4414 4416 16. XML Extensibility in DAV 4418 The XML namespace extension [W3C.REC-xml-names-19990114] is used in 4419 this specification in order to allow for new XML elements to be added 4420 without fear of colliding with other element names. Although WebDAV 4421 request and response bodies can be extended by arbitrary XML 4422 elements, which can be ignored by the message recipient, an XML 4423 element in the "DAV:" namespace SHOULD NOT be used in the request or 4424 response body unless that XML element is explicitly defined in an 4425 IETF RFC reviewed by a WebDAV working group. 4427 Extensibility with backwards-compatibility requires that both clients 4428 and servers behave appropriately when unrecognized command extensions 4429 are received. For XML processing, this means that clients and 4430 servers MUST process received XML documents as if unrecognized 4431 elements (and all children) and unrecognized attributes were not 4432 there. Ignoring custom elements for backwards-compatibility can of 4433 course be consistent with logging all information or presenting for 4434 debugging. 4436 This restriction also applies to the processing, by clients, of DAV 4437 property values where unknown XML elements SHOULD be ignored unless 4438 the property's schema declares otherwise. 4440 This restriction does not apply to setting dead DAV properties on the 4441 server where the server MUST record unknown XML elements. 4443 Additionally, this restriction does not apply to the use of XML where 4444 XML happens to be the content type of the entity body, for example, 4445 when used as the body of a PUT. 4447 When XML is used for a request or response body, the Content-Type 4448 type SHOULD be application/xml. Implementations MUST accept both 4449 text/xml and application/xml in request and response bodies. Use of 4450 text/xml is deprecated. 4452 Processing instructions in XML SHOULD be ignored by recipients. 4453 Thus, specifications extending WebDAV SHOULD NOT use processing 4454 instructions to define normative behavior. 4456 XML DTD fragments are included for all the XML elements defined in 4457 this specification. However, correct XML will not be valid according 4458 to any DTD due to namespace usage and extension rules. In 4459 particular: 4461 All elements defined in this specification use the "DAV:" 4462 namespace, 4463 Element ordering is irrelevant unless otherwise stated, 4465 Extension attributes MAY be added, 4467 For element type definitions of "ANY", the normative text 4468 definition for that element defines what can be in it and what 4469 that means. 4471 For element type definitions of "#PCDATA", extension elements MUST 4472 NOT be added. 4474 For other element type definitions, including "EMPTY", extension 4475 elements MAY be added. 4477 Note that this means that elements containing elements cannot be 4478 extended to contain text, and vice versa. 4480 With DTD validation relaxed by the rules above, the constraints 4481 described by the DTD fragments are normative (see for example 4482 Appendix A A recipient of a WebDAV message with an XML body MUST NOT 4483 validate the XML document according to any hard-coded or dynamically- 4484 declared DTD. 4486 Note that this section describes backwards-compatible extensibility 4487 rules. There might also be times when an extension is designed not 4488 to be backwards-compatible, for example defining an extension that 4489 reuses an XML element defined in this document but omitting one of 4490 the child elements required by the DTDs in this specification. 4492 17. DAV Compliance Classes 4494 A DAV compliant resource can advertise several classes of compliance. 4495 A client can discover the compliance classes of a resource by 4496 executing OPTIONS on the resource, and examining the "DAV" header 4497 which is returned. Note particularly that resources are spoken of as 4498 being compliant, rather than servers. That is because theoretically 4499 some resources on a server could support different feature sets. 4500 E.g. a server could have a sub-repository where an advanced feature 4501 like server was supported, even if that feature was not supported on 4502 all servers. 4504 Since this document describes extensions to the HTTP/1.1 protocol, 4505 minimally all DAV compliant resources, clients, and proxies MUST be 4506 compliant with [RFC2616]. 4508 A resource that is class 2 compliant must also be class 1 compliant, 4509 and a resource that is compliant with "bis" must also be class 1 4510 compliant. 4512 17.1. Class 1 4514 A class 1 compliant resource MUST meet all "MUST" requirements in all 4515 sections of this document. 4517 Class 1 compliant resources MUST return, at minimum, the value "1" in 4518 the DAV header on all responses to the OPTIONS method. 4520 17.2. Class 2 4522 A class 2 compliant resource MUST meet all class 1 requirements and 4523 support the LOCK method, the DAV:supportedlock property, the DAV: 4524 lockdiscovery property, the Time-Out response header and the Lock- 4525 Token request header. A class "2" compliant resource SHOULD also 4526 support the Time-Out request header and the 'owner' XML element. 4528 Class 2 compliant resources MUST return, at minimum, the values "1" 4529 and "2" in the DAV header on all responses to the OPTIONS method. 4531 17.3. Class 'bis' 4533 A resource can explicitly advertise its support for the revisions to 4534 RFC2518 made in this document. Class 1 must be supported as well. 4535 Class 2 MAY be supported. 4537 Example: 4539 DAV: 1, bis 4541 18. Internationalization Considerations 4543 In the realm of internationalization, this specification complies 4544 with the IETF Character Set Policy [RFC2277]. In this specification, 4545 human-readable fields can be found either in the value of a property, 4546 or in an error message returned in a response entity body. In both 4547 cases, the human-readable content is encoded using XML, which has 4548 explicit provisions for character set tagging and encoding, and 4549 requires that XML processors read XML elements encoded, at minimum, 4550 using the UTF-8 [RFC3629] and UTF-16 encodings of the ISO 10646 4551 multilingual plane. XML examples in this specification demonstrate 4552 use of the charset parameter of the Content-Type header, as defined 4553 in [RFC3023], as well as the XML declarations which provide charset 4554 identification information for MIME and XML processors. 4556 XML also provides a language tagging capability for specifying the 4557 language of the contents of a particular XML element. The "xml:lang" 4558 attribute appears on an XML element to identify the language of its 4559 content and attributes. See [XML] for definitions of values and 4560 scoping. 4562 WebDAV applications MUST support the character set tagging, character 4563 set encoding, and the language tagging functionality of the XML 4564 specification. Implementors of WebDAV applications are strongly 4565 encouraged to read "XML Media Types" [RFC3023] for instruction on 4566 which MIME media type to use for XML transport, and on use of the 4567 charset parameter of the Content-Type header. 4569 Names used within this specification fall into four categories: names 4570 of protocol elements such as methods and headers, names of XML 4571 elements, names of properties, and names of conditions. Naming of 4572 protocol elements follows the precedent of HTTP, using English names 4573 encoded in USASCII for methods and headers. Since these protocol 4574 elements are not visible to users, and are simply long token 4575 identifiers, they do not need to support multiple languages. 4576 Similarly, the names of XML elements used in this specification are 4577 not visible to the user and hence do not need to support multiple 4578 languages. 4580 WebDAV property names are qualified XML names (pairs of XML namespace 4581 name and local name). Although some applications (e.g., a generic 4582 property viewer) will display property names directly to their users, 4583 it is expected that the typical application will use a fixed set of 4584 properties, and will provide a mapping from the property name and 4585 namespace to a human-readable field when displaying the property name 4586 to a user. It is only in the case where the set of properties is not 4587 known ahead of time that an application need display a property name 4588 to a user. We recommend that applications provide human-readable 4589 property names wherever feasible. 4591 For error reporting, we follow the convention of HTTP/1.1 status 4592 codes, including with each status code a short, English description 4593 of the code (e.g., 423 (Locked)). While the possibility exists that 4594 a poorly crafted user agent would display this message to a user, 4595 internationalized applications will ignore this message, and display 4596 an appropriate message in the user's language and character set. 4598 Since interoperation of clients and servers does not require locale 4599 information, this specification does not specify any mechanism for 4600 transmission of this information. 4602 19. Security Considerations 4604 This section is provided to detail issues concerning security 4605 implications of which WebDAV applications need to be aware. 4607 All of the security considerations of HTTP/1.1 (discussed in 4608 [RFC2616]) and XML (discussed in [RFC3023]) also apply to WebDAV. In 4609 addition, the security risks inherent in remote authoring require 4610 stronger authentication technology, introduce several new privacy 4611 concerns, and may increase the hazards from poor server design. 4612 These issues are detailed below. 4614 19.1. Authentication of Clients 4616 Due to their emphasis on authoring, WebDAV servers need to use 4617 authentication technology to protect not just access to a network 4618 resource, but the integrity of the resource as well. Furthermore, 4619 the introduction of locking functionality requires support for 4620 authentication. 4622 A password sent in the clear over an insecure channel is an 4623 inadequate means for protecting the accessibility and integrity of a 4624 resource as the password may be intercepted. Since Basic 4625 authentication for HTTP/1.1 performs essentially clear text 4626 transmission of a password, Basic authentication MUST NOT be used to 4627 authenticate a WebDAV client to a server unless the connection is 4628 secure. Furthermore, a WebDAV server MUST NOT send Basic 4629 authentication credentials in a WWW-Authenticate header unless the 4630 connection is secure. Examples of secure connections include a 4631 Transport Layer Security (TLS) connection employing a strong cipher 4632 suite with mutual authentication of client and server, or a 4633 connection over a network which is physically secure, for example, an 4634 isolated network in a building with restricted access. 4636 WebDAV applications MUST support the Digest authentication scheme 4637 [RFC2617]. Since Digest authentication verifies that both parties to 4638 a communication know a shared secret, a password, without having to 4639 send that secret in the clear, Digest authentication avoids the 4640 security problems inherent in Basic authentication while providing a 4641 level of authentication which is useful in a wide range of scenarios. 4643 19.2. Denial of Service 4645 Denial of service attacks are of special concern to WebDAV servers. 4646 WebDAV plus HTTP enables denial of service attacks on every part of a 4647 system's resources. 4649 o The underlying storage can be attacked by PUTting extremely large 4650 files. 4652 o Asking for recursive operations on large collections can attack 4653 processing time. 4655 o Making multiple pipelined requests on multiple connections can 4656 attack network connections. 4658 WebDAV servers need to be aware of the possibility of a denial of 4659 service attack at all levels. The proper response to such an attack 4660 MAY be to simply drop the connection, or if the server is able to 4661 make a response, the server MAY use a 400-level status request such 4662 as 400 (Bad Request) and indicate why the request was refused (a 500- 4663 level status response would indicate that the problem is with the 4664 server, whereas unintentional DOS attacks are something the client is 4665 capable of remedying). 4667 19.3. Security through Obscurity 4669 WebDAV provides, through the PROPFIND method, a mechanism for listing 4670 the member resources of a collection. This greatly diminishes the 4671 effectiveness of security or privacy techniques that rely only on the 4672 difficulty of discovering the names of network resources. Users of 4673 WebDAV servers are encouraged to use access control techniques to 4674 prevent unwanted access to resources, rather than depending on the 4675 relative obscurity of their resource names. 4677 19.4. Privacy Issues Connected to Locks 4679 When submitting a lock request a user agent may also submit an 4680 'owner' XML field giving contact information for the person taking 4681 out the lock (for those cases where a person, rather than a robot, is 4682 taking out the lock). This contact information is stored in a DAV: 4683 lockdiscovery property on the resource, and can be used by other 4684 collaborators to begin negotiation over access to the resource. 4685 However, in many cases this contact information can be very private, 4686 and should not be widely disseminated. Servers SHOULD limit read 4687 access to the DAV:lockdiscovery property as appropriate. 4688 Furthermore, user agents SHOULD provide control over whether contact 4689 information is sent at all, and if contact information is sent, 4690 control over exactly what information is sent. 4692 19.5. Privacy Issues Connected to Properties 4694 Since property values are typically used to hold information such as 4695 the author of a document, there is the possibility that privacy 4696 concerns could arise stemming from widespread access to a resource's 4697 property data. To reduce the risk of inadvertent release of private 4698 information via properties, servers are encouraged to develop access 4699 control mechanisms that separate read access to the resource body and 4700 read access to the resource's properties. This allows a user to 4701 control the dissemination of their property data without overly 4702 restricting access to the resource's contents. 4704 19.6. Implications of XML Entities 4706 XML supports a facility known as "external entities", defined in 4707 section 4.2.2 of [XML], which instruct an XML processor to retrieve 4708 and include additional XML. An external XML entity can be used to 4709 append or modify the document type declaration (DTD) associated with 4710 an XML document. An external XML entity can also be used to include 4711 XML within the content of an XML document. For non-validating XML, 4712 such as the XML used in this specification, including an external XML 4713 entity is not required by XML. However, XML does state that an XML 4714 processor may, at its discretion, include the external XML entity. 4716 External XML entities have no inherent trustworthiness and are 4717 subject to all the attacks that are endemic to any HTTP GET request. 4718 Furthermore, it is possible for an external XML entity to modify the 4719 DTD, and hence affect the final form of an XML document, in the worst 4720 case significantly modifying its semantics, or exposing the XML 4721 processor to the security risks discussed in [RFC3023]. Therefore, 4722 implementers must be aware that external XML entities should be 4723 treated as untrustworthy. If a server implementor chooses not to 4724 handle external XML entities, it SHOULD respond to requests 4725 containing external entities with the precondition defined above (no- 4726 external-entities). 4728 There is also the scalability risk that would accompany a widely 4729 deployed application which made use of external XML entities. In 4730 this situation, it is possible that there would be significant 4731 numbers of requests for one external XML entity, potentially 4732 overloading any server which fields requests for the resource 4733 containing the external XML entity. 4735 Furthermore, there's also a risk based on the evaluation of "internal 4736 entities" as defined in section 4.2.2 of [XML]. A small, carefully 4737 crafted request using nested internal entities may require enormous 4738 amounts of memory and/or processing time to process. Server 4739 implementors should be aware of this risk and configure their XML 4740 parsers so that requests like these can be detected and rejected as 4741 early as possible. 4743 19.7. Risks Connected with Lock Tokens 4745 This specification encourages the use of "A Universally Unique 4746 Identifier (UUID) URN Namespace" ([RFC4122]) for lock tokens 4747 Section 6.4, in order to guarantee their uniqueness across space and 4748 time. Version 1 UUIDs (defined in section 4) MAY contain a "node" 4749 field that "consists of an IEEE 802 MAC address, usually the host 4750 address. For systems with multiple IEEE addresses, any available one 4751 can be used". Since a WebDAV server will issue many locks over its 4752 lifetime, the implication is that it may also be publicly exposing 4753 its IEEE 802 address. 4755 There are several risks associated with exposure of IEEE 802 4756 addresses. Using the IEEE 802 address: 4758 o It is possible to track the movement of hardware from subnet to 4759 subnet. 4761 o It may be possible to identify the manufacturer of the hardware 4762 running a WebDAV server. 4764 o It may be possible to determine the number of each type of 4765 computer running WebDAV. 4767 This risk only applies to host address based UUID versions. Section 4768 4 of [RFC4122] describes several other mechanisms for generating 4769 UUIDs that do involve the host address and therefore do not suffer 4770 from this risk. 4772 19.8. Hosting malicious scripts executed on client machines 4774 HTTP has the ability to host scripts which are executed on client 4775 machines. These scripts can be used to read another user's cookies 4776 and therefore may provide an attacker the ability to use another 4777 user's session, assume their identity temporarily and gain access to 4778 their resources. Other attacks are also possible with client- 4779 executed scripts. 4781 WebDAV may worsen this situation only by making it easier for a Web 4782 server to host content provided by many different authors (making it 4783 harder to trust the content providers) and to host content with 4784 restricted access alongside public pages (see particularly RFC3744). 4785 Note also that allowing clients to set the Content-Type might make it 4786 possible for malevolent clients to bypass type checks in other user 4787 agents. 4789 HTTP servers may mitigate some of these threats by filtering content 4790 in areas where many authors contribute pages -- the server could, for 4791 example, remove script from HTML pages. 4793 This vulnerability should provide yet another reason for server 4794 implementors and administrators not to replace authentication 4795 mechanisms with cookie-based session tokens if there's any sensitive 4796 information relying on the authenticated identity. 4798 HTTP and WebDAV client implementors might consider locking down the 4799 use of scripts and cookies based on these considerations. 4801 20. IANA Considerations 4803 20.1. New URI Schemes 4805 This specification defines two URI schemes: 4807 1. the "opaquelocktoken" scheme defined in Appendix C, and 4809 2. the "DAV" URI scheme, which historically was used in RFC2518 to 4810 disambiguate WebDAV property and XML element names and which 4811 continues to be used for that purpose in this specification and 4812 others extending WebDAV. Creation of identifiers in the "DAV:" 4813 namespace is controlled by the IETF. 4815 Note that defining new URI schemes for XML namespaces is now 4816 discouraged. "DAV:" was defined before standard best practices 4817 emerged. 4819 20.2. XML Namespaces 4821 XML namespaces disambiguate WebDAV property names and XML elements. 4822 Any WebDAV user or application can define a new namespace in order to 4823 create custom properties or extend WebDAV XML syntax. IANA does not 4824 need to manage such namespaces, property names or element names. 4826 20.3. Message Header Fields 4828 The message header fields below should be added to the permanent 4829 registry (see [RFC3864]). 4831 20.3.1. DAV 4833 Header field name: DAV 4835 Applicable protocol: http 4837 Status: standard 4839 Author/Change controller: IETF 4841 Specification document: this specification (Section 9.1) 4843 20.3.2. Depth 4845 Header field name: Depth 4847 Applicable protocol: http 4848 Status: standard 4850 Author/Change controller: IETF 4852 Specification document: this specification (Section 9.2) 4854 20.3.3. Destination 4856 Header field name: Destination 4858 Applicable protocol: http 4860 Status: standard 4862 Author/Change controller: IETF 4864 Specification document: this specification (Section 9.3) 4866 20.3.4. If 4868 Header field name: If 4870 Applicable protocol: http 4872 Status: standard 4874 Author/Change controller: IETF 4876 Specification document: this specification (Section 9.4) 4878 20.3.5. Lock-Token 4880 Header field name: Lock-Token 4882 Applicable protocol: http 4884 Status: standard 4886 Author/Change controller: IETF 4888 Specification document: this specification (Section 9.5) 4890 20.3.6. Overwrite 4892 Header field name: Overwrite 4894 Applicable protocol: http 4895 Status: standard 4897 Author/Change controller: IETF 4899 Specification document: this specification (Section 9.6) 4901 20.3.7. Timeout 4903 Header field name: Timeout 4905 Applicable protocol: http 4907 Status: standard 4909 Author/Change controller: IETF 4911 Specification document: this specification (Section 9.7) 4913 21. Acknowledgements 4915 A specification such as this thrives on piercing critical review and 4916 withers from apathetic neglect. The authors gratefully acknowledge 4917 the contributions of the following people, whose insights were so 4918 valuable at every stage of our work. 4920 Contributors to RFC2518 4922 Terry Allen, Harald Alvestrand, Jim Amsden, Becky Anderson, Alan 4923 Babich, Sanford Barr, Dylan Barrell, Bernard Chester, Tim Berners- 4924 Lee, Dan Connolly, Jim Cunningham, Ron Daniel, Jr., Jim Davis, Keith 4925 Dawson, Mark Day, Brian Deen, Martin Duerst, David Durand, Lee 4926 Farrell, Chuck Fay, Wesley Felter, Roy Fielding, Mark Fisher, Alan 4927 Freier, George Florentine, Jim Gettys, Phill Hallam-Baker, Dennis 4928 Hamilton, Steve Henning, Mead Himelstein, Alex Hopmann, Andre van der 4929 Hoek, Ben Laurie, Paul Leach, Ora Lassila, Karen MacArthur, Steven 4930 Martin, Larry Masinter, Michael Mealling, Keith Moore, Thomas Narten, 4931 Henrik Nielsen, Kenji Ota, Bob Parker, Glenn Peterson, Jon Radoff, 4932 Saveen Reddy, Henry Sanders, Christopher Seiwald, Judith Slein, Mike 4933 Spreitzer, Einar Stefferud, Greg Stein, Ralph Swick, Kenji Takahashi, 4934 Richard N. Taylor, Robert Thau, John Turner, Sankar Virdhagriswaran, 4935 Fabio Vitali, Gregory Woodhouse, and Lauren Wood. 4937 Two from this list deserve special mention. The contributions by 4938 Larry Masinter have been invaluable, both in helping the formation of 4939 the working group and in patiently coaching the authors along the 4940 way. In so many ways he has set high standards we have toiled to 4941 meet. The contributions of Judith Slein in clarifying the 4942 requirements, and in patiently reviewing draft after draft, both 4943 improved this specification and expanded our minds on document 4944 management. 4946 We would also like to thank John Turner for developing the XML DTD. 4948 The authors of RFC2518 were Yaron Goland, Jim Whitehead, A. Faizi, 4949 Steve Carter and D. Jensen. Although their names had to be removed 4950 due to IETF author count restrictions they can take credit for the 4951 majority of the design of WebDAV. 4953 Additional Contributors to This Specification 4955 Valuable contributions to this specification came from some already 4956 named. New and significant contributors to this specification must 4957 also be gratefully acknowledged. Julian Reschke, Geoff Clemm, Joel 4958 Soderberg, and Dan Brotsky hashed out specific text on the list or in 4959 meetings. Joe Hildebrand and Cullen Jennings helped close many 4960 issues. Barry Lind described an additional security consideration. 4962 Jason Crawford tracked issue status for this document for a period of 4963 years, followed by Elias Sinderson. Elias and Jim Whitehead 4964 collaborated on specific document text. 4966 21.1. Previous Authors' Addresses 4968 Y. Y. Goland, Microsoft Corporation, One Microsoft Way, Redmond, WA 4969 98052-6399. Email: yarong@microsoft.com. 4971 E. J. Whitehead, Jr., Dept. Of Information and Computer Science, 4972 University of California, Irvine, Irvine, CA 92697-3425. Email: 4973 ejw@ics.uci.edu. 4975 A. Faizi, Netscape, 685 East Middlefield Road, Mountain View, CA 4976 94043. Email: asad@netscape.com. 4978 S. R. Carter, Novell, 1555 N. Technology Way, M/S ORM F111, Orem, UT 4979 84097-2399. Email: srcarter@novell.com. 4981 D. Jensen, Novell, 1555 N. Technology Way, M/S ORM F111, Orem, UT 4982 84097-2399. Email: dcjensen@novell.com. 4984 22. References 4986 22.1. Normative References 4988 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 4989 Requirement Levels", BCP 14, RFC 2119, March 1997. 4991 [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and 4992 Languages", BCP 18, RFC 2277, January 1998. 4994 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 4995 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 4996 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 4998 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 4999 Leach, P., Luotonen, A., and L. Stewart, "HTTP 5000 Authentication: Basic and Digest Access Authentication", 5001 RFC 2617, June 1999. 5003 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 5004 Timestamps", RFC 3339, July 2002. 5006 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 5007 10646", STD 63, RFC 3629, November 2003. 5009 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 5010 Resource Identifier (URI): Generic Syntax", STD 66, 5011 RFC 3986, January 2005. 5013 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 5014 Unique IDentifier (UUID) URN Namespace", RFC 4122, 5015 July 2005. 5017 [W3C.REC-xml-infoset-20040204] 5018 Tobin, R. and J. Cowan, "XML Information Set (Second 5019 Edition)", W3C REC REC-xml-infoset-20040204, 5020 February 2004. 5022 [W3C.REC-xml-names-19990114] 5023 Hollander, D., Bray, T., and A. Layman, "Namespaces in 5024 XML", W3C REC REC-xml-names-19990114, January 1999. 5026 [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and 5027 F. Yergeau, "Extensible Markup Language (XML) 1.0 (Third 5028 Edition)", W3C REC-xml-20040204, February 2004, 5029 . 5031 22.2. Informational References 5033 [RFC2291] Slein, J., Vitali, F., Whitehead, E., and D. Durand, 5034 "Requirements for a Distributed Authoring and Versioning 5035 Protocol for the World Wide Web", RFC 2291, February 1998. 5037 [RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S., and D. 5038 Jensen, "HTTP Extensions for Distributed Authoring -- 5039 WEBDAV", RFC 2518, February 1999. 5041 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 5042 Types", RFC 3023, January 2001. 5044 [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J. 5045 Whitehead, "Versioning Extensions to WebDAV (Web 5046 Distributed Authoring and Versioning)", RFC 3253, 5047 March 2002. 5049 [RFC3648] Whitehead, J. and J. Reschke, Ed., "Web Distributed 5050 Authoring and Versioning (WebDAV) Ordered Collections 5051 Protocol", RFC 3648, December 2003. 5053 [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web 5054 Distributed Authoring and Versioning (WebDAV) Access 5055 Control Protocol", RFC 3744, May 2004. 5057 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 5058 Procedures for Message Header Fields", BCP 90, RFC 3864, 5059 September 2004. 5061 Appendix A. Notes on Processing XML Elements 5063 A.1. Notes on Empty XML Elements 5065 XML supports two mechanisms for indicating that an XML element does 5066 not have any content. The first is to declare an XML element of the 5067 form . The second is to declare an XML element of the form 5068 . The two XML elements are semantically identical. 5070 A.2. Notes on Illegal XML Processing 5072 XML is a flexible data format that makes it easy to submit data that 5073 appears legal but in fact is not. The philosophy of "Be flexible in 5074 what you accept and strict in what you send" still applies, but it 5075 must not be applied inappropriately. XML is extremely flexible in 5076 dealing with issues of white space, element ordering, inserting new 5077 elements, etc. This flexibility does not require extension, 5078 especially not in the area of the meaning of elements. 5080 There is no kindness in accepting illegal combinations of XML 5081 elements. At best it will cause an unwanted result and at worst it 5082 can cause real damage. 5084 A.3. Example - XML Syntax Error 5086 The following request body for a PROPFIND method is illegal. 5088 5089 5090 5091 5092 5094 The definition of the propfind element only allows for the allprop or 5095 the propname element, not both. Thus the above is an error and must 5096 be responded to with a 400 (Bad Request). 5098 Imagine, however, that a server wanted to be "kind" and decided to 5099 pick the allprop element as the true element and respond to it. A 5100 client running over a bandwidth limited line who intended to execute 5101 a propname would be in for a big surprise if the server treated the 5102 command as an allprop. 5104 Additionally, if a server were lenient and decided to reply to this 5105 request, the results would vary randomly from server to server, with 5106 some servers executing the allprop directive, and others executing 5107 the propname directive. This reduces interoperability rather than 5108 increasing it. 5110 A.4. Example - Unknown XML Element 5112 The previous example was illegal because it contained two elements 5113 that were explicitly banned from appearing together in the propfind 5114 element. However, XML is an extensible language, so one can imagine 5115 new elements being defined for use with propfind. Below is the 5116 request body of a PROPFIND and, like the previous example, must be 5117 rejected with a 400 (Bad Request) by a server that does not 5118 understand the expired-props element. 5120 5121 5123 5124 5126 To understand why a 400 (Bad Request) is returned let us look at the 5127 request body as the server unfamiliar with expired-props sees it. 5129 5130 5132 5134 As the server does not understand the 'expired-props' element, 5135 according to the WebDAV-specific XML processing rules specified in 5136 Section 16, it must ignore it. Thus the server sees an empty 5137 propfind, which by the definition of the propfind element is illegal. 5139 Please note that had the extension been additive it would not 5140 necessarily have resulted in a 400 (Bad Request). For example, 5141 imagine the following request body for a PROPFIND: 5143 5144 5146 5147 *boss* 5148 5150 The previous example contains the fictitious element leave-out. Its 5151 purpose is to prevent the return of any property whose name matches 5152 the submitted pattern. If the previous example were submitted to a 5153 server unfamiliar with 'leave-out', the only result would be that the 5154 'leave-out' element would be ignored and a propname would be 5155 executed. 5157 Appendix B. Notes on HTTP Client Compatibility 5159 The PUT and DELETE methods are defined in HTTP and thus may be used 5160 by HTTP clients, but the responses to PUT and DELETE have been 5161 extended in this specification, so some special consideration on 5162 backward compatibility is worthwhile. 5164 First, if a PUT or DELETE request includes a header defined in this 5165 specification (Depth or If), the server can assume the request comes 5166 from a WebDAV-compatible client. The server may even be able to 5167 track a number of requests across a session and know that a client is 5168 a WebDAV client. However, this kind of detection may not be 5169 necessary. 5171 Since any HTTP client ought to handle unrecognized 400-level and 500- 5172 level status codes as errors, the following new status codes should 5173 not present any issues: 422, 423 and 507. 424 is also a new status 5174 code but it appears only in the body of a Multistatus response. So, 5175 for example, if a HTTP client attempted to PUT or DELETE a locked 5176 resource, the 423 Locked response ought to result in a generic error 5177 presented to the user. 5179 The 207 Multistatus response is interesting because a HTTP client 5180 issuing a DELETE request to a collection might interpret a 207 5181 response as a success, even though it does not realize the resource 5182 is a collection and cannot understand that the DELETE operation might 5183 have been a complete or partial failure. Thus, a server MAY choose 5184 to treat a DELETE of a collection as an atomic operation, and use 5185 either 204 No Content in case of success, or some appropriate error 5186 response (400 or 500 level) depending on what the error was. This 5187 approach would maximize backward compatibility. However, since 5188 interoperability tests and working group discussions have not turned 5189 up any instances of HTTP clients issuing a DELETE request against a 5190 WebDAV collection, this concern may be more theoretical than 5191 practical. Thus, servers MAY instead choose to treat any such DELETE 5192 request as a WebDAV request, and send a 207 Multistatus containing 5193 more detail about what resources could not be deleted. 5195 Appendix C. The opaquelocktoken scheme and URIs 5197 The 'opaquelocktoken' URI scheme was defined in RFC2518 (and 5198 registered by IANA) in order to create syntactically correct and 5199 easy-to-generate URIs out of UUIDs, intended to be used as lock 5200 tokens and to be unique across all resources for all time. 5202 An opaquelocktoken URI is constructed by concatenating the 5203 'opaquelocktoken' scheme with a UUID, along with an optional 5204 extension. Servers can create new UUIDs for each new lock token. If 5205 a server wishes to reuse UUIDs the server MUST add an extension and 5206 the algorithm generating the extension MUST guarantee that the same 5207 extension will never be used twice with the associated UUID. 5209 OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension] 5210 ; UUID is defined in section 3 of RFC4122. Note that linear white 5211 ; space (LWS) is not allowed between elements of this production. 5213 Extension = path 5214 ; path is defined in section 3.3 of RFC3986 5216 Appendix D. Guidance for Clients Desiring to Authenticate 5218 Many WebDAV clients already implemented have account settings 5219 (similar to the way email clients store IMAP account settings). 5220 Thus, the WebDAV client would be able to authenticate with its first 5221 couple requests to the server, provided it had a way to get the 5222 authentication challenge from the server with realm name, nonce and 5223 other challenge information. Note that the results of some requests 5224 might vary according to whether the client is authenticated or not -- 5225 a PROPFIND might return more visible resources if the client is 5226 authenticated, yet not fail if the client is anonymous. 5228 There are a number of ways the client might be able to trigger the 5229 server do provide an authentication challenge. This appendix 5230 describes a couple approaches that seem particularly likely to work. 5232 The first approach is to perform a request that ought to require 5233 authentication. However, it's possible that a server might handle 5234 any request even without authentication, so to be entirely safe the 5235 client could add a conditional header to ensure that even if the 5236 request passes permissions checks it's not actually handled by the 5237 server. An example of following this approach would be to use a PUT 5238 request with an "If-Match" header with a made-up ETag value. This 5239 approach might fail to result in an authentication challenge if the 5240 server does not test authorization before testing conditionals as is 5241 required (see Section 8.1.3), or if the server does not need to test 5242 authorization. 5244 Example - forcing auth challenge with write request 5246 >>Request 5248 PUT /forceauth.txt HTTP/1.1 5249 Host: www.example.com 5250 If-Match: "xxx" 5251 Content-Type: text/plain 5252 Content-Length: 0 5254 The second approach is to use an Authorization header (defined in 5255 [RFC2617]) which is likely to be rejected by the server but which 5256 will then prompt a proper authentication challenge. For example, the 5257 client could start with a PROPFIND request containing an 5258 Authorization header containing a made-up Basic userid:password 5259 string or with actual plausible credentials. This approach relies on 5260 the server responding with a "401 Unauthorized" along with a 5261 challenge if it receives an Authorization header with an unrecognized 5262 username, invalid password, or if it doesn't even handle Basic 5263 authentication. This seems likely to work because of the 5264 requirements of RFC2617: 5266 "If the origin server does not wish to accept the credentials sent 5267 with a request, it SHOULD return a 401 (Unauthorized) response. The 5268 response MUST include a WWW-Authenticate header field containing at 5269 least one (possibly new) challenge applicable to the requested 5270 resource." 5272 Example - forcing auth challenge with Authorization header 5274 >>Request 5276 PROPFIND /docs/ HTTP/1.1 5277 Host: www.example.com 5278 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 5279 Content-type: application/xml; charset="utf-8" 5280 Content-Length: xxxx 5282 [body omitted] 5284 Appendix E. Summary of changes from RFC2518 5286 This section describes changes that are likely to result in 5287 implementation changes due to tightened requirements or changed 5288 behavior. 5290 E.1. Changes Notable to Server Implementors 5292 Tightened requirements for storing property values (Section 4.3) when 5293 "xml:lang" appears and also when values are XML fragments 5294 (specifically on preserving prefixes, namespaces and whitespace.) 5296 Changed meaning of PROPFIND 'allprop' so that it doesn't have to 5297 return live properties not defined in this specification; added 5298 'include' syntax so that clients can retrieve specific live 5299 properties along with 'allprop' results. 5301 Tightened requirements on which properties are protected and computed 5302 (Section 14). 5304 Several tightened requirements for general response handling 5305 (Section 8.1), including ETag and Location header, and reminder to 5306 use Date header. 5308 Defined response bodies for error responses, including several 5309 machine-readable precondition or postcondition codes (Section 15) for 5310 error detail. 5312 Tightened requirements for URL construction in PROPFIND (Section 8.2) 5313 responses. 5315 Tightened requirements for checking identity of lock creators 5316 (Section 6.3) during operations affected by locks. 5318 Tightened requirements for copying properties (Section 8.9.2) and 5319 moving properties (Section 8.10.1). 5321 Tightened requirements on preserving 'owner' field in locks 5322 (Section 8.11). Added "lockroot" element to lockdiscovery 5323 information. 5325 New value for "DAV:" header (Section 9.1) to advertise support for 5326 this specification. 5328 Some changes for "If:" header (Section 9.4), including "DAV:no-lock" 5329 state token and requirement to evaluate entire header. 5331 Support for UTF-16 now required (ref (Section 18)). 5333 Removed definition of "source" property and special handling for 5334 dynamic resources 5336 Replaced lock-null resources with simpler locked empty resources 5337 (Section 7.5). Lock-null resources are now not compliant with the 5338 requirements in this specification. 5340 Encouraged servers to change ETags (Section 8.1.4) only when body of 5341 resource changes. 5343 The definition of the 102 Processing response was removed and servers 5344 ought to stop sending that response when they implement this 5345 specification. 5347 Previously, servers were encouraged to return 409 status code in 5348 response to a collection LOCK request if some resource could not be 5349 locked. Now servers should use 207 Multi-Status instead. 5351 New element 'location' defined for handling redirected resources in 5352 Multi-Status. 5354 Only 'rfc1123-date' productions are legal as values for DAV: 5355 getlastmodified. 5357 New explicit requirement to do authorization checks before 5358 conditional checks (Section 8.1.3). 5360 Defined idempotence, safeness and cacheability for all new methods. 5362 Depth: Infinity doesn't affect other headers; by default these 5363 headers only apply to the Request-URI (Section 9.4). 5365 E.2. Changes Notable to Client Implementors 5367 Tightened requirements for supporting WebDAV collections 5368 (Section 5.2) within resources that do not support WebDAV (e.g. 5369 servlet containers). 5371 Redefined 'allprop' PROPFIND requests so that the server does not 5372 have to return all properties. 5374 Servers are no longer required to support all depth "infinity" 5375 PROPFIND requests, so clients need to be able to handle that and do 5376 multiple depth "1" requests instead. 5378 No more "propertybehavior" specification allowed in MOVE and COPY 5379 requests 5380 The change in behavior of LOCK with an unmapped URL might affect 5381 client implementations that counted on lock-null resources 5382 disappearing when the lock expired. Clients can no longer rely on 5383 that cleanup happening. 5385 Support for UTF-16 now required (ref (Section 18)). 5387 Removed definition of "source" property and special handling for 5388 dynamic resources. 5390 The definition of the 102 Processing response was removed and clients 5391 can safely remove code (if any) that deals with this. 5393 Servers may now reject PROPFIND depth "infinity" requests. 5395 Clients use Lock-Token header, not the If header, to provide lock 5396 token when renewing lock. Section 8.11.1 5398 Clients must refresh locks explicitly as this is now the only way to 5399 renew timeout. 5401 Appendix F. Change Log (to be removed by RFC Editor before publication) 5403 F.1. Changes from -05 to -06 5405 Specified that a successful LOCK request to an unmapped URL creates a 5406 new, empty locked resource. 5408 Resolved UNLOCK_NEEDS_IF_HEADER by clarifying that only Lock-Token 5409 header is needed on UNLOCK. 5411 Added Section 15 on preconditions and postconditions and defined a 5412 number of preconditions and postconditions. The 'lock-token-present' 5413 precondition resolves the REPORT_OTHER_RESOURCE_LOCKED issue. 5415 Added example of matching lock token to URI in the case of a 5416 collection lock in the If header section. 5418 Removed ability for Destination header to take "abs_path" in order to 5419 keep consistent with other places where client provides URLs (If 5420 header, href element in request body) 5422 Clarified the href element - that it generally contains HTTP URIs but 5423 not always. 5425 Attempted to fix the BNF describing the If header to allow commas 5427 Clarified presence of Depth header on LOCK refresh requests. 5429 F.2. Changes in -07 5431 Added text to "COPY and the Overwrite Header" section to resolve 5432 issue OVERWRITE_DELETE_ALL_TOO_STRONG. 5434 Added text to "HTTP URL Namespace Model" section to provide more 5435 clarification and examples on what consistency means and what is not 5436 required, to resolve issue CONSISTENCY. 5438 Resolve DEFINE_PRINCIPAL by importing definition of principal from 5439 RFC3744. 5441 Resolve INTEROP_DELETE_AND_MULTISTATUS by adding appendix 3 5442 discussing backward-compatibility concerns. 5444 Resolve DATE_FORMAT_GETLASTMODIFIED by allowing only rfc1123-date, 5445 not HTTP-date for getlastmodified. 5447 Resolve COPY_INTO_YOURSELF_CLARIFY by adding sentence to first para. 5448 of COPY section. 5450 Confirm that WHEN_TO_MULTISTATUS_FOR_DELETE_1 and 5451 WHEN_TO_MULTISTATUS_FOR_DELETE_2 are resolved and tweak language in 5452 DELETE section slightly to be clearly consistent. 5454 More text clarifications to deal with several of the issues in 5455 LOCK_ISSUES. This may not completely resolve that set but we need 5456 feedback from the originator of the issues at this point. 5458 Resolved COPY_INTO_YOURSELF_CLARIFY with new sentence in Copy For 5459 Collections section. 5461 Double checked that LEVEL_OR_CLASS is resolved by using class, not 5462 level. 5464 Further work to resolve IF_AND_AUTH and LOCK_SEMANTICS, clarifying 5465 text on using locks and being authenticated. 5467 Added notes on use of 503 status response to resolve issue 5468 PROPFIND_INFINITY 5470 Removed section on other uses of Metadata (and associated references) 5472 Added reference to RFC4122 for lock tokens and removed section on 5473 generating UUIDs 5475 Explained that even with language variation, a property has only one 5476 value (section 4.5). 5478 Added section on lock owner (7.1) and what to do if lock requested by 5479 unauthenticated user 5481 Removed section 4.2 -- justification on why to have metadata, not 5482 needed now 5484 Removed paragraph in section 5.2 about collections with resource type 5485 "DAV:collection" but which are non-WebDAV compliant -- not 5486 implemented. 5488 F.3. Changes in -08 5490 Added security considerations section on scripts and cookie sessions, 5491 suggested by Barry Lind 5493 Clarified which error codes are defined and undefined in MultiStatus 5495 Moved opaquelocktoken definition to an appendix and refer to RFC4122 5496 for use of 'urn:uuid:' URI scheme; fix all lock token examples to use 5497 this. 5499 Multi-status responses contain URLs which MUST either be absolute 5500 (and begin with the Request-URI or MUST be relative with new 5501 limitations. (bug 12) 5503 Moved status code sections before example sections within PROPFIND 5504 section for section ordering consistency. 5506 Clarified use of Location header with Multi-Status 5508 Bugzilla issue resolutions: bugs 9, 12, 14, 19, 20, 29, 30, 34, 36, 5509 102 and 172. 5511 F.4. Changes in -09 5513 Bugzilla editorial issues: bugs 30, 57, 63, 68, 88, 89, 168, 180, 5514 182, 185, 187. 5516 More clarity between URL namespaces and XML namespaces, particularly 5517 at the beginning of paragraphs using the word namespace 5519 More consistency in referring to properties with the namespace, as in 5520 "DAV:lockdiscovery", and referring to XML element names in single 5521 quotes, e.g. 'allprop' element. 5523 Figure (example) formatting fixes 5525 Bugzilla issues: bugs 24, 37, 39, 43, 45, 27, 25 5527 Replaced references to "non-null state" of resources with more clear 5528 language about URLs that are mapped to resources, bug 25. Also added 5529 definition of URL/URI mapping. Bug 40. 5531 Bugzilla issues: bug 7, 8, 9, 41, 47, 51, 62, 93, 171, 172. Bugs 28 5532 and 94 were iterated on. 5534 Bugzilla issues: 56, 59, 79, 99, 103, 175, 178. Part of bug 23. 5535 Iteration on bug 10. 5537 Iteration on bugs 10, 46 and 47. Bug 11. 5539 Remove "102 Processing" response 5541 Fix bug 46, 105, 107, 120, 140 and 201. 5543 Another stab at bug 12 - relative v. absolute URLs in Multi-Status 5544 response hrefs 5546 Fix bug 6, 11, 15, 16, 28, 32, 42, 51, 52, 53, 58, 60, 62, 186, 189, 5547 191, 199, 200 5549 Fix bug 96 5551 F.5. Changes in -10 5553 Clarify lock intro text on when a client might use another client's 5554 lock token - suggestion by Geoff, Nov 15 5556 Removed Force-Authenticate header and instead added an appendix 5557 explaining how existing mechanisms might resolve the need of clients 5558 to get an authentication challenge (bug 18). 5560 Bug 62, 113, 125, 131, 143, 144, 171, 193 5562 Bug 176, 177, 179, 181, 184, 206, 207, 208 5564 F.6. Changes in -11 5566 Bug 10, 50, 92, 213, 214, 215 5568 not recommend use of 414 for over-long Destination URI, bug 179 5570 Changes for bug 10, 31, 42, 44, 46, 47, 80, 86, 99, 124, 132, 143, 5571 147, 152, 166, 177, 188, 216, 218 5573 Various changes discussed in conference call, including bug 10, 42, 5574 44, 80, 97, 152. 5576 Bugs 55, 85, 86 5578 Author's Address 5580 Lisa Dusseault 5581 Open Source Application Foundation 5582 2064 Edgewood Dr. 5583 Palo Alto, CA 94303 5584 US 5586 Email: lisa@osafoundation.org 5588 Intellectual Property Statement 5590 The IETF takes no position regarding the validity or scope of any 5591 Intellectual Property Rights or other rights that might be claimed to 5592 pertain to the implementation or use of the technology described in 5593 this document or the extent to which any license under such rights 5594 might or might not be available; nor does it represent that it has 5595 made any independent effort to identify any such rights. Information 5596 on the procedures with respect to rights in RFC documents can be 5597 found in BCP 78 and BCP 79. 5599 Copies of IPR disclosures made to the IETF Secretariat and any 5600 assurances of licenses to be made available, or the result of an 5601 attempt made to obtain a general license or permission for the use of 5602 such proprietary rights by implementers or users of this 5603 specification can be obtained from the IETF on-line IPR repository at 5604 http://www.ietf.org/ipr. 5606 The IETF invites any interested party to bring to its attention any 5607 copyrights, patents or patent applications, or other proprietary 5608 rights that may cover technology that may be required to implement 5609 this standard. Please address the information to the IETF at 5610 ietf-ipr@ietf.org. 5612 Disclaimer of Validity 5614 This document and the information contained herein are provided on an 5615 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 5616 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 5617 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 5618 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 5619 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 5620 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 5622 Copyright Statement 5624 Copyright (C) The Internet Society (2006). This document is subject 5625 to the rights, licenses and restrictions contained in BCP 78, and 5626 except as set forth therein, the authors retain all their rights. 5628 Acknowledgment 5630 Funding for the RFC Editor function is currently provided by the 5631 Internet Society.