Releases: mirage/ocaml-cohttp
5.1.0
4.1.1
2.5.7
6.0.0~alpha0
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.
- The user provided Response can contain a connection header. That header
- 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_action
that can be used to
create a server without going through Conduit. This allows creating an
async TCP server using the Tcp module fromAsync_unix
and lets the user
have more control over how theReader.t
andWriter.t
are created.
- Add
- http(header): faster
to_lines
andto_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
- This new implementation does not depend on conduit and has a simpler and
- 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 instantiateXMLHttpRequest
object on boot (mefyl #922)
5.0.0
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 (hereHeader.clean_dup
).Semantic changes
Two functions have a semantic change :
get
andupdate
.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 previousget
function.
update
update
is a pretty new function (#703) and changes are minor and related toget
semantic changes.update h k f
is now modifying only the last occurrences of the headerk
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, exceptset-cookie
)get_multi_concat
has been added to get a result similar to the previousget
function.
- New implementation of Header modules using an associative list instead of a map, with one major semantic change (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)
BreakingConduit_lwt_unix.connect
'sctx
param type chaged fromctx
toctx 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
v4.0.0
CHANGES:
- cohttp.response: fix malformed status header for custom status codes (@mseri @aalekseyev #752)
- Remove dependency to base (@samoht #745)
- fix opam files and dependencies
- add GitHub Actions workflow (@smorimoto #739)
- lwt_jsoo: Forward exceptions to caller when response is null (@mefyl #738)
- Remove wrapped false (@rgrinberg #734)
- Use implicit executable dependency for generate.exe (@TheLortex #735)
- cohttp: update HTTP codes (@emillon #711)
- cohttp: add Uti.t to uri scheme (@brendanlong #707)
- cohttp: fix chunked encoding of empty body (@mefyl #715)
- cohttp-async: fix body not being uploaded with unchunked Async.Pipe (@mefyl #706)
- cohttp-{async, lwt}: fix suprising behaviours of Body.is_empty (@anuragsoni #714 #712 #713)
- cohttp-lwt-jsoo: rename Cohttp_lwt_xhr to Cohttp_lwt_jsoo for consistency (@mseri #717)
- refactoring of tests (@mseri #709, @dinosaure #692)
- update documentation (@dinosaure #716, @mseri #720)
- cohttp: fix transfer-encoding ordering in headers (@mseri #721)
- lower-level support for long-running cohttp-async connections (@brendanlong #704)
- fix deadlock in logging (@dinosaure #722)
- add of_form and to_form functions to body (@seliopou #440, @mseri #723)
- cohttp-lwt: partly inline read_response, fix body stream leak (@madroach @dinosaure #696)
- improve media type parsing (@seliopou #542, @dinosaure #725)
- add comparison functions for Request.t and Response.t via ppx_compare (@msaffer-js @dinosaure #686)
- [reverted] breaking changes to client and server API to use conduit
3.0.0 (@dinosaure #692). However, as the design discussion did not reach
consensus, these changes were reverted to preserve better compatibility with
existing cohttp users. (#741, @samoht)
v2.5.5
CHANGES:
Cohttp_async.resolve_local_file
,Cohttp_lwt.resolve_local_file
andCohttp_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 ofCohttp_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
CHANGES:
- cohttp: update HTTP codes (@emillon #711)
- cohttp: add Uti.t to uri scheme (@brendanlong #707)
- cohttp: fix chunked encoding of empty body (@mefyl #715)
- cohttp-async: fix body not being uploaded with unchunked Async.Pipe (@mefyl #706)
- cohttp-{async, lwt}: fix suprising behaviours of Body.is_empty (@anuragsoni #714 #712 #713)
- port to conduit 3.0.0: minor breaking changes on the server API, an explicit distinction
between cohttp-lwt-unix (using tls), cohttp-lwt-notls and cohttp-lwt-ssl (using lwt_ssl),
and includes ssl in cohttp-async (@dinosaure #692) - cohttp-lwt-jsoo: rename Cohttp_lwt_xhr to Cohttp_lwt_jsoo for consistency (@mseri #717)
- refactoring of tests (@mseri #709, @dinosaure #692)
- update documentation (@dinosaure #716, @mseri #720)
- cohttp: fix transfer-encoding ordering in headers (@mseri #721)
- lower-level support for long-running cohttp-async connections (@brendanlong #704)
- fix deadlock in logging (@dinosaure #722)
- add of_form and to_form functions to body (@seliopou #440, @mseri #723)
- cohttp-lwt: partly inline read_response, fix body stream leak (@madroach @dinosaure #696)
- improve media type parsing (@seliopou #542, @dinosaure #725)
- add comparison functions for Request.t and Response.t via ppx_compare (@msaffer-js @dinosaure #686)
v2.5.4
CHANGES: