Skip to content

Releases: mirage/ocaml-cohttp

5.1.0

04 Apr 07:25
Compare
Choose a tag to compare

CHANGES:

  • cohttp,cohttp-async server: correctly close broken streams (reported by Stéphane Glondu, fix by samhot and anuragsoni)

4.1.1

04 Apr 07:12
Compare
Choose a tag to compare

CHANGES:

  • cohttp,cohttp-async server: correctly close broken streams (reported by Stéphane Glondu, fix by samhot and anuragsoni)

2.5.7

04 Apr 07:02
Compare
Choose a tag to compare

CHANGES:

  • cohttp,cohttp-async server: correctly close broken streams (reported by Stéphane Glondu, fix by samhot and anuragsoni)

6.0.0~alpha0

27 Oct 08:08
Compare
Choose a tag to compare

CHANGES:

  • cohttp-eio: ensure "Host" header is the first header in http client requests (bikallem #939)
  • cohttp-eio: add TE header in client. Check TE header is server (bikallem #941)
  • cohttp-eio: add User-Agent header to request from Client (bikallem #940)
  • cohttp-eio: add Content-Length header to request/response (bikallem #929)
  • cohttp-eio: add cohttp-eio client api - Cohttp_eio.Client (bikallem #879)
  • http: add requires_content_length function for requests and responses (bikallem #879)
  • cohttp-eio: use Eio.Buf_write and improve server API (talex5 #887)
  • cohttp-eio: update to Eio 0.3 (talex5 #886)
  • cohttp-eio: convert to Eio.Buf_read (talex5 #882)
  • cohttp lwt client: Connection cache and explicit pipelining (madroach #853)
  • http: add Http.Request.make and simplify Http.Response.make (bikallem mseri #878)
  • http: add pretty printer functions (bikallem #880)
  • New eio based client and server on top of the http library (bikallem #857)
  • New curl based clients (rgrinberg #813)
    • cohttp-curl-lwt for an Lwt backend
    • cohttp-curl-async for an Async backend
  • Completely new Parsing layers for servers (anuragsoni #819)
    • Cohttp now uses an optimized parser for requests.
    • The new parser produces much less temporary buffers during read operations
      in servers.
  • Faster header comparison (gasche #818)
  • Introduce http package containing common signatures and structures useful for
    compatibility with cohttp - and no dependencies (rgrinberg #812)
  • async(server): allow reading number of active connections (anuragsoni #809)
  • Various internal refactors (rgrinberg, mseri, #802, #812, #820, #800, #799,
    #797)
  • http (all cohttp server backends): Consider the connection header in response
    in addition to the request when deciding on whether to keep a connection
    alive (anuragsoni, #843)
    • The user provided Response can contain a connection header. That header
      will also be considered in addition to the connection header in requests
      when deciding whether to use keep-alive. This allows a handler to decide to
      close a connection even if the client requested a keep-alive in the
      request.
  • async(server): allow creating a server without using conduit (anuragsoni #839)
    • Add Cohttp_async.Server.Expert.create and
      Cohttp_async.Server.Expert.create_with_response_actionthat can be used to
      create a server without going through Conduit. This allows creating an
      async TCP server using the Tcp module from Async_unix and lets the user
      have more control over how the Reader.t and Writer.t are created.
  • http(header): faster to_lines and to_frames implementation (mseri #847)
  • cohttp(cookies): use case-insensitive comparison to check for set-cookies (mseri #858)
  • New lwt based server implementation: cohttp-server-lwt-unix
    • This new implementation does not depend on conduit and has a simpler and
      more flexible API
  • async: Adapt cohttp-curl-async to work with core_unix.
  • Breaking changes
    • refactor: move opam metadata to dune-project (rgrinberg #811)
    • refactor: deprecate Cohttp_async.Io (rgrinberg #807)
    • fix: move more internals to Private (rgrinberg #806)
    • fix: deprecate transfer encoding field (rgrinberg #805)
    • refactor: deprecate Cohttp_async.Body_raw (rgrinberg #804)
    • fix: deprecate more aliases (rgrinberg #803)
    • refactor: deprecate connection value(rgrinberg #798)
    • refactor: deprecate using attributes (rgrinberg #796)
    • cleanup: remove cohttp-{curl,server}-async (rgrinberg #904)
    • cleanup: remove cohttp-{curl,server,proxy}-lwt (rgrinberg #904)
    • fix: all parsers now follow the spec and require \r\n endings.
      Previously, the \r was optional. (rgrinberg, #921)
  • cohttp-lwt-jsoo: do not instantiate XMLHttpRequest object on boot (mefyl #922)

5.0.0

15 Dec 12:32
Compare
Choose a tag to compare

CHANGES:

  • Cohttp.Header: new implementation (lyrm #747)

    • New implementation of Header modules using an associative list instead of a map, with one major semantic change (function get, see below), and some new functions (clean_dup, get_multi_concat)
    • More Alcotest tests as well as fuzzing tests for this particular module.

    Purpose

    The new header implementation uses an associative list instead of a map to represent headers and is focused on predictability and intuitivity: except for some specific and documented functions, the headers are always kept in transmission order, which makes debugging easier and is also important for RFC7230§3.2.2 that states that multiple values of a header must be kept in order.

    Also, to get an intuitive function behaviour, no extra work to enforce RFCs is done by the basic functions. For example, RFC7230§3.2.2 requires that a sender does not send multiple values for a non list-value header. This particular rule could require the Header.add function to remove previous values of non-list-value headers, which means some changes of the headers would be out of control of the user. With the current implementation, an user has to actively call dedicated functions to enforce such RFCs (here Header.clean_dup).

    Semantic changes

    Two functions have a semantic change : get and update.

    get

    get was previously doing more than just returns the value associated to a key; it was also checking if the searched header could have multiple values: if not, the last value associated to the header was returned; otherwise, all the associated values were concatenated and returned. This semantics does not match the global idea behind the new header implementation, and would also be very inefficient.

    • The new get function only returns the last value associated to the searched header.
    • get_multi_concat function has been added to get a result similar to the previous get function.

    update

    update is a pretty new function (#703) and changes are minor and related to get semantic changes.

    • update h k f is now modifying only the last occurrences of the header k instead of all its occurrences.
    • a new function update_all function has been added and work on all the occurrences of the updated header.

    New functions :

    • clean_dup enables the user to clean headers that follows the {{:https://tools.ietf.org/html/rfc7230#section-3.2.2} RFC7230§3.2.2} (no duplicate, except set-cookie)
    • get_multi_concat has been added to get a result similar to the previous get function.
  • Cohttp.Header: performance improvement (mseri, anuragsoni #778)
    Breaking the headers are no-longer lowercased when parsed, the headers key comparison is case insensitive instead.

  • cohttp-lwt-unix: Adopt ocaml-conduit 5.0.0 (smorimoto #787)
    Breaking Conduit_lwt_unix.connect's ctx param type chaged from ctx to ctx Lazy.t

  • cohttp-mirage: fix deprecated fmt usage (tmcgilchrist #783)

  • lwt_jsoo: Use logs for the warnings and document it (mseri #776)

  • lwt: Use logs to warn users about leaked bodies and document it (mseri #771)

  • lwt, lwt_unix: Improve use of logs and the documentation, fix bug in the Debug.enable_debug function (mseri #772)

  • lwt_jsoo: Fix exception on connection errors in chrome (mefyl #761)

  • lwt_jsoo: Fix Lwt.wakeup_exn Invalid_arg exception when a js
    stack overflow happens in the XHR completion handler (mefyl #762).

  • lwt_jsoo: Add test suite (mefyl #764).

2.5.6

15 Dec 09:55
Compare
Choose a tag to compare

CHANGES:

  • cohttp-async: use package core_unix instead of core, to prepare for core release 0.15 (aalekseyev #791 - backport)
  • cohttp-mirage: fix deprecated fmt usage (tmcgilchrist #791 - backport)

v4.0.0

24 Mar 12:44
Compare
Choose a tag to compare

CHANGES:

v2.5.5

16 Mar 10:36
Compare
Choose a tag to compare

CHANGES:

  • Cohttp_async.resolve_local_file, Cohttp_lwt.resolve_local_file and Cohttp_lwt_unix.resolve_file
    are now the same code under the hood (Cohttp.Path.resolve_local_file). The old names
    have been preserved for compatibility, but will be marked as deprecated in the next release. This
    changes the behavior of Cohttp_lwt_unix.resolve_file: it now percent-decodes the paths and blocks
    escaping from the docroot correctly. This also fixes and tests the corner cases in these methods
    when the docroot is empty. (@ewanmellor #755)

v3.0.0

02 Nov 19:51
Compare
Choose a tag to compare

CHANGES:

v2.5.4

22 Jul 08:53
c087cea
Compare
Choose a tag to compare

CHANGES:

  • cohttp: a change in #694 modified the semantics of Header.replace.
    The semantics change is reverted, and a new Header.update function
    is introduced, following the semantics of Map.update. (#702 @mseri)
  • cohttp: reimplement update to support compilers that are older than
    OCaml 4.06 (#703 @mseri)