Skip to content

Commit 2d44eb1

Browse files
committed
[new release] cohttp, cohttp-top, cohttp-mirage, cohttp-lwt, cohttp-lwt-unix, cohttp-lwt-jsoo and cohttp-async (5.0.0)
CHANGES: - Cohttp.Header: new implementation (lyrm mirage/ocaml-cohttp#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](https://tools.ietf.org/html/rfc7230#section-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 (mirage/ocaml-cohttp#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 mirage/ocaml-cohttp#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 mirage/ocaml-cohttp#787) **Breaking** `Conduit_lwt_unix.connect`'s `ctx` param type chaged from `ctx` to `ctx Lazy.t` - cohttp-mirage: fix deprecated fmt usage (tmcgilchrist mirage/ocaml-cohttp#783) - lwt_jsoo: Use logs for the warnings and document it (mseri mirage/ocaml-cohttp#776) - lwt: Use logs to warn users about leaked bodies and document it (mseri mirage/ocaml-cohttp#771) - lwt, lwt_unix: Improve use of logs and the documentation, fix bug in the Debug.enable_debug function (mseri mirage/ocaml-cohttp#772) - lwt_jsoo: Fix exception on connection errors in chrome (mefyl mirage/ocaml-cohttp#761) - lwt_jsoo: Fix `Lwt.wakeup_exn` `Invalid_arg` exception when a js stack overflow happens in the XHR completion handler (mefyl mirage/ocaml-cohttp#762). - lwt_jsoo: Add test suite (mefyl mirage/ocaml-cohttp#764).
1 parent 5251963 commit 2d44eb1

File tree

7 files changed

+375
-0
lines changed
  • packages
    • cohttp-async/cohttp-async.5.0.0
    • cohttp-lwt-jsoo/cohttp-lwt-jsoo.5.0.0
    • cohttp-lwt-unix/cohttp-lwt-unix.5.0.0
    • cohttp-lwt/cohttp-lwt.5.0.0
    • cohttp-mirage/cohttp-mirage.5.0.0
    • cohttp-top/cohttp-top.5.0.0
    • cohttp/cohttp.5.0.0

7 files changed

+375
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "CoHTTP implementation for the Async concurrency library"
13+
description: """
14+
An implementation of an HTTP client and server using the Async
15+
concurrency library. See the `Cohttp_async` module for information
16+
on how to use this. The package also installs `cohttp-curl-async`
17+
and a `cohttp-server-async` binaries for quick uses of a HTTP(S)
18+
client and server respectively.
19+
"""
20+
license: "ISC"
21+
tags: ["org:mirage" "org:xapi-project"]
22+
homepage: "https://github.com/mirage/ocaml-cohttp"
23+
doc: "https://mirage.github.io/ocaml-cohttp/"
24+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
25+
depends: [
26+
"ocaml" {>= "4.08"}
27+
"dune" {>= "2.0"}
28+
"async_kernel" {>= "v0.14.0"}
29+
"async_unix" {>= "v0.14.0"}
30+
"async" {>= "v0.14.0"}
31+
"base" {>= "v0.11.0"}
32+
"core" {with-test}
33+
"core_unix" {>= "v0.14.0"}
34+
"cohttp" {= version}
35+
"conduit-async" {>= "1.2.0"}
36+
"magic-mime"
37+
"mirage-crypto" {with-test}
38+
"logs"
39+
"fmt" {>= "0.8.2"}
40+
"sexplib0"
41+
"ppx_sexp_conv" {>= "v0.13.0"}
42+
"ounit" {with-test}
43+
"uri" {>= "2.0.0"}
44+
"uri-sexp"
45+
"ipaddr"
46+
]
47+
build: [
48+
["dune" "subst"] {dev}
49+
["dune" "build" "-p" name "-j" jobs]
50+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
51+
]
52+
available: arch != "s390x"
53+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
54+
url {
55+
src:
56+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
57+
checksum: [
58+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
59+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
60+
]
61+
}
62+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "CoHTTP implementation for the Js_of_ocaml JavaScript compiler"
13+
description: """
14+
An implementation of an HTTP client for JavaScript, but using the
15+
CoHTTP types. This lets you build HTTP clients that can compile
16+
natively (using one of the other Cohttp backends such as `cohttp-lwt-unix`)
17+
and also to native JavaScript via js_of_ocaml.
18+
"""
19+
license: "ISC"
20+
tags: ["org:mirage" "org:xapi-project"]
21+
homepage: "https://github.com/mirage/ocaml-cohttp"
22+
doc: "https://mirage.github.io/ocaml-cohttp/"
23+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
24+
depends: [
25+
"ocaml" {>= "4.08"}
26+
"dune" {>= "2.0"}
27+
"cohttp" {= version}
28+
"cohttp-lwt" {= version}
29+
"logs"
30+
"lwt" {>= "3.0.0"}
31+
"lwt_ppx" {with-test}
32+
"conf-npm" {with-test}
33+
"js_of_ocaml" {>= "3.3.0"}
34+
"js_of_ocaml-ppx" {>= "3.3.0"}
35+
"js_of_ocaml-lwt" {>= "3.5.0"}
36+
]
37+
build: [
38+
["dune" "subst"] {dev}
39+
["dune" "build" "-p" name "-j" jobs]
40+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
41+
]
42+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
43+
url {
44+
src:
45+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
46+
checksum: [
47+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
48+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
49+
]
50+
}
51+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "CoHTTP implementation for Unix and Windows using Lwt"
13+
description: """
14+
An implementation of an HTTP client and server using the Lwt
15+
concurrency library. See the `Cohttp_lwt_unix` module for information
16+
on how to use this. The package also installs `cohttp-curl-lwt`
17+
and a `cohttp-server-lwt` binaries for quick uses of a HTTP(S)
18+
client and server respectively.
19+
20+
Although the name implies that this only works under Unix, it
21+
should also be fine under Windows too."""
22+
license: "ISC"
23+
tags: ["org:mirage" "org:xapi-project"]
24+
homepage: "https://github.com/mirage/ocaml-cohttp"
25+
doc: "https://mirage.github.io/ocaml-cohttp/"
26+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
27+
depends: [
28+
"ocaml" {>= "4.08"}
29+
"dune" {>= "2.0"}
30+
"conduit-lwt" {>= "5.0.0"}
31+
"conduit-lwt-unix" {>= "5.0.0"}
32+
"cmdliner"
33+
"magic-mime"
34+
"logs"
35+
"fmt" {>= "0.8.2"}
36+
"cohttp-lwt" {= version}
37+
"ppx_sexp_conv" {>= "v0.13.0"}
38+
"lwt" {>= "3.0.0"}
39+
"base-unix"
40+
"ounit" {with-test}
41+
]
42+
build: [
43+
["dune" "subst"] {dev}
44+
["dune" "build" "-p" name "-j" jobs]
45+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
46+
]
47+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
48+
url {
49+
src:
50+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
51+
checksum: [
52+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
53+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
54+
]
55+
}
56+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "CoHTTP implementation using the Lwt concurrency library"
13+
description: """
14+
This is a portable implementation of HTTP that uses the Lwt
15+
concurrency library to multiplex IO. It implements as much of the
16+
logic in an OS-independent way as possible, so that more specialised
17+
modules can be tailored for different targets. For example, you
18+
can install `cohttp-lwt-unix` or `cohttp-lwt-jsoo` for a Unix or
19+
JavaScript backend, or `cohttp-mirage` for the MirageOS unikernel
20+
version of the library. All of these implementations share the same
21+
IO logic from this module."""
22+
license: "ISC"
23+
tags: ["org:mirage" "org:xapi-project"]
24+
homepage: "https://github.com/mirage/ocaml-cohttp"
25+
doc: "https://mirage.github.io/ocaml-cohttp/"
26+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
27+
depends: [
28+
"ocaml" {>= "4.08"}
29+
"dune" {>= "2.0"}
30+
"cohttp" {= version}
31+
"lwt" {>= "2.5.0"}
32+
"sexplib0"
33+
"ppx_sexp_conv" {>= "v0.13.0"}
34+
"logs"
35+
"uri" {>= "2.0.0"}
36+
]
37+
build: [
38+
["dune" "subst"] {dev}
39+
["dune" "build" "-p" name "-j" jobs]
40+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
41+
]
42+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
43+
url {
44+
src:
45+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
46+
checksum: [
47+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
48+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
49+
]
50+
}
51+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: ["Anil Madhavapeddy" "Thomas Gazagnaire"]
4+
license: "ISC"
5+
tags: ["org:mirage" "org:xapi-project"]
6+
homepage: "https://github.com/mirage/ocaml-cohttp"
7+
doc: "https://mirage.github.io/ocaml-cohttp/"
8+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
9+
synopsis: "CoHTTP implementation for the MirageOS unikernel"
10+
description: """
11+
This HTTP implementation uses the Cohttp portable implementaiton
12+
along with the Lwt threading library in order to provide a
13+
`Cohttp_mirage` functor that can be used in MirageOS unikernels
14+
to build very small and efficient HTTP clients and servers
15+
without having a hard dependency on an underlying operating
16+
system.
17+
18+
Please see <https://mirage.io> for a self-hosted explanation
19+
and instructions on how to use this library."""
20+
depends: [
21+
"ocaml" {>= "4.08"}
22+
"dune" {>= "2.0"}
23+
"mirage-flow" {>= "2.0.0"}
24+
"mirage-channel" {>= "4.0.0"}
25+
"conduit" {>= "2.0.2"}
26+
"conduit-mirage" {>= "2.0.2"}
27+
"mirage-kv" {>= "3.0.0"}
28+
"lwt" {>= "2.4.3"}
29+
"cohttp" {= version}
30+
"cohttp-lwt" {= version}
31+
"fmt" {>= "0.8.7"}
32+
"astring"
33+
"magic-mime"
34+
"ppx_sexp_conv" {>= "v0.13.0"}
35+
]
36+
build: [
37+
["dune" "subst"] {dev}
38+
["dune" "build" "-p" name "-j" jobs]
39+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
40+
]
41+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
42+
url {
43+
src:
44+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
45+
checksum: [
46+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
47+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
48+
]
49+
}
50+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "CoHTTP toplevel pretty printers for HTTP types"
13+
description: """
14+
This library installs toplevel prettyprinters for CoHTTP
15+
types such as the `Request`, `Response` and `Types` modules.
16+
Once this library has been loaded, you can directly see the
17+
values of those types in toplevels such as `utop` or `ocaml`."""
18+
license: "ISC"
19+
tags: ["org:mirage" "org:xapi-project"]
20+
homepage: "https://github.com/mirage/ocaml-cohttp"
21+
doc: "https://mirage.github.io/ocaml-cohttp/"
22+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
23+
depends: [
24+
"ocaml" {>= "4.08"}
25+
"dune" {>= "2.0"}
26+
"cohttp" {= version}
27+
]
28+
build: [
29+
["dune" "subst"] {dev}
30+
["dune" "build" "-p" name "-j" jobs]
31+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
32+
]
33+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
34+
url {
35+
src:
36+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
37+
checksum: [
38+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
39+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
40+
]
41+
}
42+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"

packages/cohttp/cohttp.5.0.0/opam

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: [
4+
"Anil Madhavapeddy"
5+
"Stefano Zacchiroli"
6+
"David Sheets"
7+
"Thomas Gazagnaire"
8+
"David Scott"
9+
"Rudi Grinberg"
10+
"Andy Ray"
11+
]
12+
synopsis: "An OCaml library for HTTP clients and servers"
13+
description: """
14+
Cohttp is an OCaml library for creating HTTP daemons. It has a portable
15+
HTTP parser, and implementations using various asynchronous programming
16+
libraries.
17+
18+
See the cohttp-async, cohttp-lwt, cohttp-lwt-unix, cohttp-lwt-jsoo and
19+
cohttp-mirage libraries for concrete implementations for particular
20+
targets.
21+
22+
You can implement other targets using the parser very easily. Look at the `IO`
23+
signature in `lib/s.mli` and implement that in the desired backend.
24+
25+
You can activate some runtime debugging by setting `COHTTP_DEBUG` to any
26+
value, and all requests and responses will be written to stderr. Further
27+
debugging of the connection layer can be obtained by setting `CONDUIT_DEBUG`
28+
to any value."""
29+
license: "ISC"
30+
tags: ["org:mirage" "org:xapi-project"]
31+
homepage: "https://github.com/mirage/ocaml-cohttp"
32+
doc: "https://mirage.github.io/ocaml-cohttp/"
33+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
34+
depends: [
35+
"ocaml" {>= "4.08"}
36+
"dune" {>= "2.0"}
37+
"re" {>= "1.9.0"}
38+
"uri" {>= "2.0.0"}
39+
"uri-sexp"
40+
"sexplib0"
41+
"ppx_sexp_conv" {>= "v0.13.0"}
42+
"stringext"
43+
"base64" {>= "3.1.0"}
44+
"fmt" {with-test}
45+
"jsonm" {build}
46+
"alcotest" {with-test}
47+
"crowbar" {with-test}
48+
]
49+
build: [
50+
["dune" "subst"] {dev}
51+
["dune" "build" "-p" name "-j" jobs]
52+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
53+
]
54+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
55+
url {
56+
src:
57+
"https://github.com/mirage/ocaml-cohttp/releases/download/v5.0.0/cohttp-5.0.0.tbz"
58+
checksum: [
59+
"sha256=fd6ff4b86c818355d61b3a08628596dbf517d6a7da6e8edec481bb0653ca5a05"
60+
"sha512=f0bfd715806965af5488010cc9388d05406b67ece0b2cb8f7803553b17a5264d03094e59127a62d37c0d6c0e74d4717e643737c43d9bcfb10b112a73d5f49c4d"
61+
]
62+
}
63+
x-commit-hash: "5f9c0ae88a69e4280810fe73344367e90954dea5"

0 commit comments

Comments
 (0)