Skip to content

Commit b4d5699

Browse files
committed
Flatten body so hackney can see it as empty
1 parent 48990fe commit b4d5699

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Unpublished
4+
5+
- Fixed unnecessary `Content-Type` and `Content-Length` headers being added to
6+
requests with empty bodies.
7+
38
## v1.3.0 - 2024-12-07
49

510
- Updated for `gleam_stdlib` v0.45.0.

src/gleam_hackney_ffi.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
send(Method, Url, Headers, Body) ->
66
Options = [{with_body, true}],
7-
case hackney:request(Method, Url, Headers, Body, Options) of
7+
case hackney:request(Method, Url, Headers, iolist_to_binary(Body), Options) of
88
{ok, Status, ResponseHeaders, ResponseBody} ->
99
{ok, {response, Status, ResponseHeaders, ResponseBody}};
1010

0 commit comments

Comments
 (0)