From: Stephane Glondu Date: Sat, 14 Mar 2026 08:43:01 +0000 (+0100) Subject: New upstream version 5.3.1 X-Git-Tag: archive/raspbian/6.2.2-1+rpi1^2~5^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=868d94f3df24ef0c44ad73aecd1a2a6cc87999a9;p=ocaml-cohttp.git New upstream version 5.3.1 --- diff --git a/CHANGES.md b/CHANGES.md index 1768901..0fa3b6a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## v5.3.1 (2023-12-13) + +- cohttp: case-insensitive check of set-cookies (chomosuke, #1008) + ## v5.3.0 (2023-07-21) - cohttp-async: support for base/async v0.16 diff --git a/cohttp-async.opam b/cohttp-async.opam index 7a8d4c0..94820af 100644 --- a/cohttp-async.opam +++ b/cohttp-async.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp-lwt-jsoo.opam b/cohttp-lwt-jsoo.opam index 1af72ff..523a6af 100644 --- a/cohttp-lwt-jsoo.opam +++ b/cohttp-lwt-jsoo.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp-lwt-unix.opam b/cohttp-lwt-unix.opam index 7765875..48a535d 100644 --- a/cohttp-lwt-unix.opam +++ b/cohttp-lwt-unix.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp-lwt.opam b/cohttp-lwt.opam index cbfd435..9ab7d41 100644 --- a/cohttp-lwt.opam +++ b/cohttp-lwt.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp-mirage.opam b/cohttp-mirage.opam index 61186f6..d1ad724 100644 --- a/cohttp-mirage.opam +++ b/cohttp-mirage.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: ["Anil Madhavapeddy" "Thomas Gazagnaire"] diff --git a/cohttp-mirage/src/client.ml b/cohttp-mirage/src/client.ml index a2de582..d564f89 100644 --- a/cohttp-mirage/src/client.ml +++ b/cohttp-mirage/src/client.ml @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * cohttp v5.3.0 + * cohttp v5.0.0-25-g0bb4e19 *) open Lwt.Infix diff --git a/cohttp-mirage/src/io.ml b/cohttp-mirage/src/io.ml index 301c634..cd58561 100644 --- a/cohttp-mirage/src/io.ml +++ b/cohttp-mirage/src/io.ml @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * cohttp v5.3.0 + * cohttp v5.0.0-25-g0bb4e19 *) open Lwt.Infix diff --git a/cohttp-mirage/src/io.mli b/cohttp-mirage/src/io.mli index 1768bbe..6e071dc 100644 --- a/cohttp-mirage/src/io.mli +++ b/cohttp-mirage/src/io.mli @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * cohttp v5.3.0 + * cohttp v5.0.0-25-g0bb4e19 *) (** Cohttp IO implementation using Mirage channels. *) diff --git a/cohttp-mirage/src/static.ml b/cohttp-mirage/src/static.ml index 99e8aa3..5d98cf5 100644 --- a/cohttp-mirage/src/static.ml +++ b/cohttp-mirage/src/static.ml @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * cohttp v5.3.0 + * cohttp v5.0.0-25-g0bb4e19 *) module Key = Mirage_kv.Key diff --git a/cohttp-mirage/src/static.mli b/cohttp-mirage/src/static.mli index b9e9545..2865fac 100644 --- a/cohttp-mirage/src/static.mli +++ b/cohttp-mirage/src/static.mli @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * cohttp v5.3.0 + * cohttp v5.0.0-25-g0bb4e19 *) (** Serve static HTTP sites from a Mirage key-value store. *) diff --git a/cohttp-top.opam b/cohttp-top.opam index bad206e..a47a541 100644 --- a/cohttp-top.opam +++ b/cohttp-top.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp.opam b/cohttp.opam index 54c0733..18c7a01 100644 --- a/cohttp.opam +++ b/cohttp.opam @@ -1,4 +1,4 @@ -version: "5.3.0" +version: "5.3.1" opam-version: "2.0" maintainer: "anil@recoil.org" authors: [ diff --git a/cohttp/src/cookie.ml b/cohttp/src/cookie.ml index 89f1718..8b6777d 100644 --- a/cohttp/src/cookie.ml +++ b/cohttp/src/cookie.ml @@ -133,13 +133,29 @@ module Set_cookie_hdr = struct :: alist with Failure _ -> alist + let caseless_equal a b = + if a == b then true + else + let len = String.length a in + len = String.length b + && + let stop = ref false in + let idx = ref 0 in + while (not !stop) && !idx < len do + let c1 = String.unsafe_get a !idx in + let c2 = String.unsafe_get b !idx in + if Char.lowercase_ascii c1 <> Char.lowercase_ascii c2 then stop := true; + incr idx + done; + not !stop + (* TODO: check dupes+order *) let extract hdr = Header.fold - (function - | "set-cookie" -> extract_1_0 - | "set-cookie2" -> extract_1_1 - | _ -> fun _ a -> a) + (fun k c a -> + if caseless_equal k "set-cookie" then extract_1_0 c a + else if caseless_equal k "set-cookie2" then extract_1_1 c a + else a) hdr [] let value { cookie = _, v; _ } = v diff --git a/dune-project b/dune-project index b7266ed..16d2838 100644 --- a/dune-project +++ b/dune-project @@ -1,3 +1,3 @@ (lang dune 2.0) (name cohttp) -(version v5.3.0) +(version v5.0.0-25-g0bb4e19)