diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http/generic_request.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index 704f159245..e8525b3d15 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -89,6 +89,9 @@ class Net::HTTPGenericRequest def set_body_internal(str) #:nodoc: internal use only raise ArgumentError, "both of body argument and HTTPRequest#body set" if str and (@body or @body_stream) self.body = str if str + if @body.nil? && @body_stream.nil? && @body_data.nil? && request_body_permitted? + self.body = '' + end end # |