diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fbfad6..3b6d989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.7.2 - 2024-12-08 + +- Fixed warnings on `gleam_stdlib` v0.45.0. + ## v3.7.1 - 2024-11-19 - Fixed warnings on `gleam_stdlib` v0.42.0. diff --git a/gleam.toml b/gleam.toml index df2add8..3d7cb30 100644 --- a/gleam.toml +++ b/gleam.toml @@ -11,7 +11,7 @@ links = [ ] [dependencies] -gleam_stdlib = "~> 0.32" +gleam_stdlib = ">= 0.45.0 and < 2.0.0" [dev-dependencies] gleeunit = "~> 1.0" diff --git a/src/gleam/http/cookie.gleam b/src/gleam/http/cookie.gleam index 8c6b401..e22d512 100644 --- a/src/gleam/http/cookie.gleam +++ b/src/gleam/http/cookie.gleam @@ -2,7 +2,6 @@ import gleam/http.{type Scheme} import gleam/int import gleam/list import gleam/option.{type Option, Some} -import gleam/regex import gleam/result import gleam/string @@ -97,8 +96,9 @@ pub fn set_header(name: String, value: String, attributes: Attributes) -> String /// discarded. /// pub fn parse(cookie_string: String) -> List(#(String, String)) { - let assert Ok(re) = regex.from_string("[,;]") - regex.split(re, cookie_string) + cookie_string + |> string.split(";") + |> list.flat_map(string.split(_, ",")) |> list.filter_map(fn(pair) { case string.split_once(string.trim(pair), "=") { Ok(#("", _)) -> Error(Nil)