Skip to content

Commit cdd39fc

Browse files
fix(client): always add content-length to post body, even when empty
1 parent 06fbee7 commit cdd39fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/openlayer/internal/transport/pooled_net_requester.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def build_request(request, &blk)
7575

7676
case body
7777
in nil
78-
nil
78+
req["content-length"] ||= 0 unless req["transfer-encoding"]
7979
in String
8080
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
8181
req.body_stream = Openlayer::Internal::Util::ReadIOAdapter.new(body, &blk)

0 commit comments

Comments
 (0)