httpwg / http-core

Core HTTP Specifications
https://httpwg.org/http-core/
470 stars 43 forks source link

Content and Payload #878

Closed mnot closed 3 years ago

mnot commented 3 years ago

I'm a little uneasy that the majority of headers that are prefixed with Content- are actually scoped to the selected representation.

E.g., Content-Length, Content-Type, Content-Encoding, Content-Language. The only registered, current Content- headers that actually about the content (using the current definition in Semantics) are Content-Location and Content-Disposition, AFAICT. Not sure about Content-Range; it's defined in terms of the selected representation, but could equally be defined in terms of content, I suspect.

It might help to add a small note to the content section that explains that the Content- prefix doesn't necessarily imply that the header is strictly about the content. Also might be worth mentioning in the registration considerations.

ioggstream commented 3 years ago

Reading semantics I have some doubts on C-L wrt partial representation

The "Content-Length" header field indicates the associated representation's data length

this seems to be the full representation data (eg. see C-L + HEAD). But then

When transferring a representation as content, Content-Length refers specifically to the amount of data enclosed so that it can be used to delimit framing

what happens with Content-Lenght value in a range response? The complete representation-data or the actual content?

reschke commented 3 years ago

"A Content-Length header field present in a 206 response indicates the number of octets in the content of this message, which is usually not the complete length of the selected representation. Each Content-Range header field includes information about the selected representation's complete length."

So the case of a 206 response is special-cased.

ioggstream commented 3 years ago

It seems to me that C-L is more often used to convey "messaging" information, than the actual metadata (which happens only when HEAD is used).