Skip to content

Commit

Permalink
Fix: #1366. Include Mark's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed Sep 9, 2021
1 parent 7f97d14 commit 0fa2c20
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions draft-ietf-httpbis-digest-headers.md
Expand Up @@ -538,45 +538,38 @@ To allow sender and recipient to provide a checksum which is independent from
* Status: standard


# Use of Digest when acting on resources {#acting-on-resources}
# Using Digest in State-Changing Requests {#state-changing-requests}

POST and PATCH requests can appear to convey partial representations but are
semantically acting on resources. The enclosed representation, including its
metadata, refers to that action.

In these requests the representation digest MUST be computed on the
representation-data of that action.
When the representation enclosed in a state-changing request
does not describe the target resource,
the representation digest MUST be computed on the
representation-data.
This is the only possible choice because representation digest requires complete
representation metadata (see {{representation-digest}}).

In responses,

- if the representation describes the status of the request,
`Digest` MUST be computed on the enclosed representation
(see {{post-referencing-action}} );
(see {{post-referencing-status}} );

- if there is a referenced resource
`Digest` MUST be computed on the selected representation of the referenced resource
even if that is different from the target resource.
That might or might not result in computing `Digest` on the enclosed representation.

The latter case might be done according to the HTTP semantics of the given
The latter will be done according to the HTTP semantics of the given
method, for example using the `Content-Location` header field.
In contrast, the `Location` header field does not affect `Digest` because
it is not representation metadata.

## Digest and PATCH

In PATCH requests, the representation digest MUST be computed on the patch document
For example, in PATCH requests, the representation digest
will be computed on the patch document
because the representation metadata refers to the patch document and not
to the target resource (see Section 2 of {{?PATCH=RFC5789}}).

In PATCH responses, the representation digest MUST be computed on the selected
In responses instead, the representation digest will be computed on the selected
representation of the patched resource.

`Digest` usage with PATCH is thus very similar to POST, but with the
resource's own semantic partly implied by the method and by the patch document.

## Digest and Content-Location in Responses {#digest-and-content-location}

When a state-changing method returns the `Content-Location` header field, the
Expand Down Expand Up @@ -889,7 +882,7 @@ Note that a `204 No Content` response without content but with the same
`Digest` field-value would have been legitimate too.
In that case, `Content-Digest` would have been computed on an empty content.

## POST Response Describes the Request Status {#post-referencing-action}
## POST Response Describes the Request Status {#post-referencing-status}

The request `Digest` field-value is computed on the enclosed representation (see
{{acting-on-resources}}).
Expand Down

0 comments on commit 0fa2c20

Please sign in to comment.