lib/zold/http.rb in zold-0.4.1 vs lib/zold/http.rb in zold-0.4.2

- old
+ new

@@ -38,22 +38,23 @@ end def get http = Net::HTTP.new(@uri.host, @uri.port) http.read_timeout = 5 - http.continue_timeout = 5 return http.request_get(@uri.path, headers) rescue StandardError => e return Net::HTTPServerError.new('1.1', '599', e.message) end def put(body) http = Net::HTTP.new(@uri.host, @uri.port) - http.read_timeout = 5 - http.continue_timeout = 5 + http.read_timeout = 60 return http.request_put( @uri.path, body, - headers.merge('Content-Type': 'text/plain') + headers.merge( + 'Content-Type': 'text/plain', + 'Content-Length': body.length.to_s + ) ) rescue StandardError => e return Net::HTTPServerError.new('1.1', '599', e.message) end