@@ -79,15 +79,15 @@ field value that indicates a series of encodings adds further complexity.
7979A more complex example involves HTTP Range Requests ({{Section 14 of
8080HTTP}}), where a client fetches multiple partial representations from
8181different origins and "stitches" them back into a whole. Unfortunately, if the
82- origins apply different content coding , the `Repr-Digest` field will vary by the
82+ origins apply different content codings , the `Repr-Digest` field will vary by the
8383server's selected encoding (i.e. the Content-Encoding header field, {{Section
84848.4 of HTTP}}). This provides a challenge for a client - in order to verify the
8585integrity of the pieced-together whole it would need to remove the encoding of
8686each part, combine them, and then encode the result in order to compare against
8787one or more `Repr-Digest`s.
8888
8989The Accept-Encoding header field ({{Section 12.5.3 of HTTP}}) provides the means
90- to indicate preferences for content coding . It is possible for an endpoint to
90+ to indicate preferences for content codings . It is possible for an endpoint to
9191indicate a preference for no encoding, for example by sending the "identity"
9292token. However, codings often provide data compression that is advantageous.
9393Disabling content coding in order to simplify integrity checking is possibly an
@@ -119,16 +119,21 @@ The definitions "representation", "selected representation", "representation
119119data", "representation metadata", and "content" in this document are to be
120120interpreted as described in {{!HTTP=RFC9110}}.
121121
122+ This document uses the line folding strategies described in {{!FOLDING=RFC8792}}.
123+
124+ The term "digest" is to be interpreted as described in {{DIGEST-FIELDS}}.
125+
122126
123127# The Unencoded-Digest Field {#unencoded-digest}
124128
125129The `Unencoded-Digest` HTTP field can be used in requests and responses to
126130communicate digests that are calculated using a hashing algorithm applied to the
127- representation with no content coding ({{Section 8.4.1 of HTTP}}).
131+ entire selected representation data with no content codings applied ({{Section
132+ 8.4.1 of HTTP}}).
128133
129134Apart from the content coding concerns, `Unencoded-Digest` behaves similarly
130135to `Repr-Digest` ({{Section 3 of DIGEST-FIELDS}}). In the absence of content
131- coding , `Unencoded-Digest` is identical to `Repr-Digest`.
136+ codings , `Unencoded-Digest` is identical to `Repr-Digest`.
132137
133138` Unencoded-Digest` is a `Dictionary` (see {{Section 3.2 of STRUCTURED-FIELDS}})
134139where each :
@@ -193,10 +198,10 @@ If `Want-Unencoded-Digest` is used in a response, it indicates that the server
193198would like the client to provide the `Unencoded-Digest` field on future requests.
194199
195200` Want-Unencoded-Digest` is only a hint. The receiver of the field can ignore it
196- and send an `Unencoded-Digest` field using any algorithm or omit one entirely. It
197- is not a protocol error if preferences are ignored. Applications that use
198- ` Unencoded-Digest` and `Want-Unencoded-Digest` can define expectations or
199- constraints that operate in addition to this specification.
201+ and send an `Unencoded-Digest` field using any algorithm or omit the field
202+ entirely. It is not a protocol error if preferences are ignored. Applications
203+ that use `Unencoded-Digest` and `Want-Unencoded-Digest` can define expectations
204+ or constraints that operate in addition to this specification.
200205
201206`Want-Unencoded-Digest` is of type `Dictionary` where each :
202207
@@ -220,13 +225,13 @@ Want-Unencoded-Digest: sha-512=3, sha-256=10, unixsum=0
220225# Messages containing both Unencoded-Digest and Content-Encoding {#encoding-and-unencoded}
221226
222227Digests delivered through `Unencoded-Digest` apply to the unencoded
223- representation. If a message is received with content coding , a recipient needs
228+ representation. If a message is received with content codings , a recipient needs
224229to decode the message in order to calculate the digest that can subsequently be
225230used for validation. If multiple content codings are applied, the recipient
226231needs to decode all encodings in order before validation.
227232
228233Since the digest is calculated on unencoded representation bytes, validation of
229- a message with content coding (as described above) can only succeed where the
234+ a message with content codings (as described above) can only succeed where the
230235decoded output produces the same byte sequence as the input. While many
231236registered content codings behave this way, there is no requirement for them to
232237do so and it remains a possibility that decoding could produce a
@@ -239,10 +244,10 @@ is advised when selecting content coding for use with `Unencoded-Digest`.
239244Integrity fields can be used in combination to address different and
240245complementary needs, particularly the cases described in {{introduction}}.
241246
242- In the following examples, the unencoded response data is the string "An
243- unexceptional string" following by an LF. For presentation purposes, the
244- response body is displayed as a sequence of hex-encoded bytes because it
245- contains non-printable characters.
247+ In the following examples, the selected representation data with no content
248+ codings applied is : " An unexceptional string" following by an LF. For
249+ presentation purposes, the response content is displayed as a sequence of
250+ hex-encoded bytes because it contains non-printable characters.
246251
247252The first example demonstrates a request that uses content negotiation.
248253
@@ -261,6 +266,7 @@ and `Unencoded-Digest` therefore differ.
261266NOTE : ' \' line wrapping per RFC 8792
262267
263268HTTP/1.1 200 OK
269+ Content-Type : text/plain
264270Content-Encoding : gzip
265271Repr-Digest : \
266272 sha-256=:XyjvEuFb1P5rqc2le3vQm7M96DwZhvmOwqHLu2xVpY4= :
@@ -274,7 +280,7 @@ ca cc 4b e7 02 00 7e af 07 44
27428018 00 00 00
275281
276282~~~
277- {: title="GET response with GZIP-encoded content"}
283+ {: title="GET response with GZIP content coding "}
278284
279285The second example demonstrates a range request with content negotiation.
280286
@@ -287,18 +293,19 @@ Range: bytes=0-10
287293~~~
288294{: title="Range request with content negotiation"}
289295
290- The server responds with a 206 Partial Content response using GZIP encoding, it
291- has three different Integrity fields. The `Content-Digest` relates to the
292- response message content that can be used to validate the integrity of the
296+ The server responds with a 206 ( Partial Content) response using GZIP content
297+ coding, it has three different Integrity fields. The `Content-Digest` relates to
298+ the response content that can be used to validate the integrity of the
293299received part. `Repr-Digest` and `Unencoded-Digest` can be used later once the
294300entire object is reconstructed. The choice of which to use is left to the
295- application that would consider a range of factors outside the scope of
296- this document.
301+ application that would consider a range of factors outside the scope of this
302+ document.
297303
298304~~~ http-message
299305NOTE : ' \' line wrapping per RFC 8792
300306
301307HTTP/1.1 206 Partial Content
308+ Content-Type : text/plain
302309Content-Encoding : gzip
303310Content-Range : bytes 0-9/44
304311Content-Digest : \
@@ -310,7 +317,7 @@ Unencoded-Digest: \
310317
3113181f 8b 08 00 79 1f 08 64 00 ff
312319~~~
313- {: title="Partial response with GZIP encoding "}
320+ {: title="Partial response with GZIP content coding "}
314321
315322
316323# Security Considerations
0 commit comments