Skip to content

Improved interface for headers, bug fixes for Uri, empty chunks, uninstalling binaries

Compare
Choose a tag to compare
@rgrinberg rgrinberg released this 04 Apr 18:16
· 1707 commits to master since this release

Compatibility breaking interface changes:

  • Response.t and Request.t fields are no longer mutable
  • [lwt] Fix types in post_form to be a string * string list instead
    of a Header.t (#257)
  • Simplify the Net signature which needs to be provided for Lwt servers
    to not be required. Only the Lwt client needs a Net functor argument
    to make outgoing connections. (#274)
  • Request.has_body does not permit a body to be set for methods that
    RFC7231 forbids from having one (HEAD, GET and DELETE).

New features and bug fixes:

  • Fix linking problem caused by sub-libraries using cohttp modules outside the
    cohttp pack.
  • Added async client for S3. (#304)
  • Fix String_io.read_line to trim '\r' from end of string (#300)
  • Fix cohttp-server-lwt to correctly bind to a specific interface (#298).
  • Add Cohttp_async.request to send raw, umodified requests.
  • Supplying a content-range or content-range header in any client
    request will always override any other encoding preference (#281).
  • Add a cohttp-lwt-proxy to act as an HTTP proxy. (#248)
  • Extend cohttp-server-async file server to work with HTTPS (#277).
  • Copy basic auth from Uri.userinfo into the Authorization header
    for HTTP requests. (#255)
  • Install binaries via an OPAM .install file to ensure that they are
    reliably uninstalled. (#252)
  • Use the magic-mime library to add a MIME type by probing filename
    during static serving in the Lwt/Async backends. (#260)
  • Add Cohttp.Header.add_opt_unless_exists to set a header only if
    an override wasn't supplied, and to initialise a fresh Header value
    if none is present.
  • Do not override user-supplied headers in post_form or redirect.
  • Request.make does not inject a transfer-encoding header if there
    is no body present in the request (#246).
  • Server.respond no longer overrides user-supplied headers that
    specify the content-length or transfer-encoding headers (#268).
  • cohttp_server_lwt and cohttp_server_async now include sizes in
    directory listing titles
  • Add Header.add_multi to initialise a header structure with multiple
    fields more efficiently (#272).
  • Expose IO.ic and IO.oc types for Cohttp_async (#271).
  • Skip empty body chunks in Transfer_io.write (#270).
  • With the Lwt backend, read hangs if trying to fetch more than
    Sys.max_string_length (which can be triggered on 32-bit platforms).
    Read only a maximum that fits into a string (#282).
  • cohttp-curl-lwt now takes http method as parameter (#288)