Skip to content

Commit

Permalink
v3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Nov 19, 2024
1 parent 74977e0 commit 9fa61f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 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.1 - 2024-11-19

- Fixed warnings on `gleam_stdlib` v0.42.0.

## v3.7.0 - 2024-09-12

- The `gleam/http/request` module gains the `remove_cookie` function.
Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "gleam_http"
version = "3.7.0"
version = "3.7.1"
licences = ["Apache-2.0"]
description = "Types and functions for Gleam HTTP clients and servers"
gleam = ">= 1.0.0"
Expand Down
12 changes: 3 additions & 9 deletions src/gleam/http/request.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import gleam/list
import gleam/option.{type Option}
import gleam/result
import gleam/string
import gleam/string_builder
import gleam/uri.{type Uri, Uri}

/// A HTTP request.
Expand Down Expand Up @@ -179,18 +178,13 @@ pub fn set_query(
query: List(#(String, String)),
) -> Request(body) {
let pair = fn(t: #(String, String)) {
string_builder.from_strings([
uri.percent_encode(t.0),
"=",
uri.percent_encode(t.1),
])
uri.percent_encode(t.0) <> "=" <> uri.percent_encode(t.1)
}
let query =
query
|> list.map(pair)
|> list.intersperse(string_builder.from_string("&"))
|> string_builder.concat
|> string_builder.to_string
|> list.intersperse("&")
|> string.concat
|> option.Some
Request(..req, query: query)
}
Expand Down

0 comments on commit 9fa61f8

Please sign in to comment.