Menu

#1 HTTP chunked transfer encoding includes Content-Length header field

Beta03
closed
2014-09-12
2014-08-15
abesting
No

The Content-Length field seems to be sent always by the server after the last chunk, which is only allowed if the client specifies trailers options.

Example TCP tream is attached to this ticket.

See http://en.wikipedia.org/wiki/Chunked_transfer_encoding

1 Attachments

Discussion

  • Stefan Schlichting

    Hi,

    I looked at http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1 and for me it seems to be ok to send the "Content-Length" header field as Trailer even if the Client did not request it by using the "TE" header field.
    The relevant part is in
    "A server using chunked transfer-coding in a response MUST NOT use the trailer for any header fields unless at least one of the following is true:

    a)the request included a TE header field that indicates "trailers" is acceptable in the transfer-coding of the response, as described in section 14.39; or,

    b)the server is the origin server for the response, the trailer fields consist entirely of optional metadata, and the recipient could use the message (in a manner acceptable to the origin server) without receiving this metadata. In other words, the origin server is willing to accept the possibility that the trailer fields might be silently discarded along the path to the client."

    So the device is the origin server and the "content-length" is not mandatory it seems ok.

    So if you agree, I would close the ticket.

     

    Last edit: Stefan Schlichting 2014-08-18
  • Stefan Schlichting

    • labels: HTTP --> HTTP, Chunked Transfer Coding
    • assigned_to: Stefan Schlichting
     
  • Stefan Schlichting

    • status: open --> closed
     

Log in to post a comment.