208 Already Reported
Description
The 208 Already Reported
status code indicates that the members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again. This status code is used exclusively within WebDAV environments, particularly in responses to WebDAV PROPFIND requests with Depth: infinity.
This status code was introduced in RFC 5842 (Binding Extensions to WebDAV) to address the issue of duplicate resource reporting when a server has multiple bindings (hard links) to the same resource. Without this status code, the same resource might appear multiple times in a response if it can be reached through different paths.
The 208 Already Reported
status helps prevent redundancy in responses and makes handling of complex directory structures with bindings more efficient.
Syntax
The server includes a 208 Already Reported
status within a multi-status response:
HTTP/1.1 207 Multi-Status
Content-Type: application/xml
Content-Length: [length in bytes]
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/collection/resource</d:href>
<d:propstat>
<d:prop>
<!-- Properties -->
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/another/path/to/same/resource</d:href>
<d:status>HTTP/1.1 208 Already Reported</d:status>
</d:response>
<!-- Additional responses as needed -->
</d:multistatus>
Examples
WebDAV PROPFIND with Bindings Example
A client requests properties for a collection that contains bindings to the same resource:
Client Request:
PROPFIND /workspace/ HTTP/1.1
Host: webdav.example.org
Depth: infinity
Content-Type: application/xml
Content-Length: 124
<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<prop>
<displayname/>
<getlastmodified/>
<getcontentlength/>
</prop>
</propfind>
Server Response:
HTTP/1.1 207 Multi-Status
Content-Type: application/xml
Content-Length: 1253
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/workspace/</d:href>
<d:propstat>
<d:prop>
<d:displayname>Main Workspace</d:displayname>
<d:getlastmodified>Wed, 15 Jun 2023 12:30:15 GMT</d:getlastmodified>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/workspace/project/document.docx</d:href>
<d:propstat>
<d:prop>
<d:displayname>Project Document</d:displayname>
<d:getlastmodified>Mon, 12 Jun 2023 09:45:22 GMT</d:getlastmodified>
<d:getcontentlength>24680</d:getcontentlength>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/workspace/shared/same-document.docx</d:href>
<d:status>HTTP/1.1 208 Already Reported</d:status>
</d:response>
<d:response>
<d:href>/workspace/archive/also-same-document.docx</d:href>
<d:status>HTTP/1.1 208 Already Reported</d:status>
</d:response>
</d:multistatus>
In this example, the document exists at three different paths due to WebDAV bindings, but the server only reports the full properties once and uses 208 status for the other instances.
Complex Directory Structure Example
A client requests all resources in a complex directory structure with bindings:
Client Request:
PROPFIND /projects/ HTTP/1.1
Host: webdav.example.com
Depth: infinity
Content-Type: application/xml
Content-Length: 98
<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<allprop/>
</propfind>
Server Response (partial):
HTTP/1.1 207 Multi-Status
Content-Type: application/xml
Content-Length: 2587
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:">
<!-- Many responses for different resources -->
<d:response>
<d:href>/projects/active/shared-library/utils.js</d:href>
<d:propstat>
<d:prop>
<!-- Full properties for utils.js -->
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/projects/templates/js/utils.js</d:href>
<d:status>HTTP/1.1 208 Already Reported</d:status>
</d:response>
<d:response>
<d:href>/projects/archived/2022/libs/utils.js</d:href>
<d:status>HTTP/1.1 208 Already Reported</d:status>
</d:response>
<!-- More responses -->
</d:multistatus>
Summary
The 208 Already Reported
status code is a specialized response used in WebDAV environments to optimize responses involving multiple bindings to the same resource. By indicating that a resource has already been reported elsewhere in the response, it prevents redundant information and reduces response size. This status code is particularly valuable in complex directory structures with many bindings or when performing deep (Depth: infinity) operations on WebDAV collections. While its use is limited to WebDAV and similar protocols that support bindings, it plays an important role in making these systems more efficient.