Skip to content

v1.0.4

Choose a tag to compare

@mrrubinos mrrubinos released this 20 Aug 08:17
· 20 commits to main since this release
222c4db

Added

  • nhttp_h1:encode_response/2 takes t:nhttp_h1:enc_opts/0.
    #{content_length => omit} suppresses the automatic Content-Length
    field. A server that answers a CONNECT request with a 2xx status uses
    it, because RFC 9110 Section 8.6 forbids the field there and the response
    map carries no request method

Fixed

  • nhttp_h1:encode_response/1 emits Content-Length: 0 on a response with
    an empty body. The call omitted the field before, so a client on a
    persistent connection read the next response as content
  • nhttp_h1:encode_response/1 emits no Content-Length at a 1xx, 204, or
    304 status (RFC 9110 Section 8.6). At 304 the field is valid only at the
    length that a 200 response carries, which the encoder cannot compute, so a
    caller that knows the value supplies it in the header list

Full Changelog: 1.0.3...v1.0.4