rfc-8144

Use of the Prefer Header Field in Web Distributed Authoring and Versioning (WebDAV)

K. Murchison
date2017-04 streamIETF wgnon working group statusPROPOSED STANDARD pages28 canonicalhttps://www.rfc-editor.org/rfc/rfc8144 doi10.17487/RFC8144
This document defines how the Prefer header field (RFC 7240) can be used by a Web Distributed Authoring and Versioning (WebDAV) client to request that certain behaviors be employed by a server while constructing a response to a request. Furthermore, it defines the new "depth-noroot" preference.

updates

Extracted elements (18)

design-rationale §2.3

The requirement that a minimal MKCALENDAR/MKCOL success response have an empty body is based on two constraints: RFC 4791 requires any successful body to be a CALDAV:mkcalendar-response XML element, and RFC 5689 states that an empty body with a success status implies all properties were set, making a non-empty body ambiguous.

http

design-rationale §3.1

The 'return=representation' preference on state-changing requests provides atomicity: by returning the server's current representation in the response, the client can know any changes were produced by the server rather than a concurrent client, eliminating the need for a subsequent GET request.

http

interoperability-note §A

This document is based on the Microsoft 'Brief' and extended 'Depth' header fields. The behaviors in Sections 2.1 and 2.2 are identical to those of the Brief header field with PROPFIND and PROPPATCH; Section 4 behavior matches the '1,noroot' and 'infinity,noroot' Depth values. If a server receives both Brief and Prefer headers, clients can expect the server to ignore Brief and use only Prefer.

http

normative-requirement §2.1 MUST

If omitting 404 DAV:propstat elements would result in a DAV:response containing zero DAV:propstat elements, the server MUST substitute either a DAV:propstat with empty DAV:prop and 200 OK status, or a DAV:status element of value 200 OK.

http

normative-requirement §4 SHOULD NOT

The 'depth-noroot' preference is only intended to be used with HTTP methods whose definitions explicitly provide support for the Depth header field, and only applies when Depth has a value of '1' or 'infinity' (either implicitly or explicitly).

http

normative-requirement §4 MAY

The 'depth-noroot' preference MAY be used in conjunction with the 'return=minimal' preference in a single request.

http

normative-requirement §3.2 SHOULD

When a conditional state-changing request contains 'return=representation' and the specified condition evaluates to false, the server SHOULD include an entity representing the current state of the resource in the resulting 412 (Precondition Failed) response.

http

normative-requirement §2.3 SHOULD

When a MKCALENDAR or extended MKCOL request contains 'return=minimal' and the collection is created with all requested properties set successfully, the server SHOULD return a 201 (Created) response with an empty (zero-length) message body.

http

normative-requirement §2.1 SHOULD

When a PROPFIND or REPORT request contains 'return=minimal', the server SHOULD omit all DAV:propstat XML elements containing a DAV:status of 404 (Not Found) from the 207 Multi-Status response.

http

normative-requirement §2.2 SHOULD

When a PROPPATCH request contains 'return=minimal' and all instructions are processed successfully, the server SHOULD return 204 (No Content) or 200 (OK) with zero-length body rather than a 207 Multi-Status response.

http

normative-requirement §3.1 SHOULD

When a state-changing request (PUT, COPY/MOVE, PATCH, POST) contains 'return=representation' and the resource is created or updated successfully, the server SHOULD include an entity representing the current state of the resource in the 201 or 200 response.

http

protocol-element §4

The 'depth-noroot' preference indicates the client wishes the server to exclude the target (root) resource from processing and only apply the HTTP method to the target resource's subordinate resources. It is only applicable when Depth header has value '1' or 'infinity'.

http

protocol-element §2

The 'return=minimal' preference from RFC 7240 is given precise WebDAV semantics: for PROPFIND/REPORT it means omit 404 propstat elements; for PROPPATCH it means return 200/204 instead of 207; for MKCALENDAR/MKCOL it means return 201 with empty body on success.

http

protocol-element §3.2

The 'return=representation' preference from RFC 7240 is extended to apply to 412 (Precondition Failed) responses in addition to 2xx responses, enabling clients to retrieve the current resource state without a separate GET when a conditional update fails.

http

registry §6.1

The 'depth-noroot' preference has been added to the HTTP Preferences Registry defined in Section 5.1 of RFC 7240, with a reference to RFC 8144, Section 4.

registry, http

registry §6.2

The HTTP Method Registry references for MKCALENDAR, MKCOL, PROPFIND, PROPPATCH, and REPORT have been updated to include RFC 8144 as an additional reference alongside their existing RFC citations.

registry, http

registry §6.3

The HTTP Status Codes registry entry for status code 412 (Precondition Failed) has been updated to include RFC 8144, Section 3.2 as an additional reference alongside RFC 7232.

registry, http

security-consideration §5

No new security considerations are introduced by use of the Prefer header field with WebDAV requests, beyond those discussed in RFC 7240 and those already inherent in those WebDAV requests.

security, http