module Fog
  module HP
    class Storage
      class Real

        # Create a new object
        #
        # ==== Parameters
        # * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
        #
        def put_object(container, object, data, options = {})
          data = Fog::Storage.parse_data(data)
          headers = data[:headers].merge!(options)
          response = request(
            :body     => data[:body],
            :expects  => 201,
            :headers  => headers,
            :method   => 'PUT',
            :path     => "#{URI.escape(container)}/#{URI.escape(object)}"
          )
          response
        end

      end
    end
  end
end

module Fog
  module HP
    class Storage
      class Real

        # Create a new object
        #
        # ==== Parameters
        # * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
        #
        def put_object(container, object, data, options = {})
          data = Fog::Storage.parse_data(data)
          headers = data[:headers].merge!(options)
          if headers.has_key?('Transfer-Encoding')
            headers.delete('Content-Length')
          end
          response = request(
            :body     => data[:body],
            :expects  => 201,
            :headers  => headers,
            :method   => 'PUT',
            :path     => "#{URI.escape(container)}/#{URI.escape(object)}"
          )
          response
        end

      end
    end
  end
end

Remove Content-Length header incase Transfer-Encoding header is present. This was done to get the streaming for PUT working.
Remove Content-Length header incase Transfer-Encoding header is present. This was done to get the streaming for PUT working.
