Skip to content

Commit

Permalink
v3.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 8, 2024
1 parent 9fa61f8 commit cf61f0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ links = [
]

[dependencies]
gleam_stdlib = "~> 0.32"
gleam_stdlib = ">= 0.45.0 and < 2.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
6 changes: 3 additions & 3 deletions src/gleam/http/cookie.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cf61f0b

Please sign in to comment.