Skip to content

Commit 5819eec

Browse files
author
Nathan Sutton
committed
Always set a body in Net::HTTP when doing PUT or POST
1 parent 846abec commit 5819eec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/zencoder/http/net_http.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ def http
7070

7171
def request
7272
r = request_class.new(path)
73-
r.body = body if body
73+
if body
74+
r.body = body
75+
elsif [:post, :put].include?(@method)
76+
r.body = ""
77+
end
78+
7479
if headers
7580
headers.each do |header, value|
7681
r.add_field(header.to_s, value.to_s)

0 commit comments

Comments
 (0)