lib/elasticsearch/transport/transport/base.rb in elasticsearch-transport-1.0.16.pre2 vs lib/elasticsearch/transport/transport/base.rb in elasticsearch-transport-1.0.16
- old
+ new
@@ -9,11 +9,11 @@
DEFAULT_PROTOCOL = 'http'
DEFAULT_RELOAD_AFTER = 10_000 # Requests
DEFAULT_RESURRECT_AFTER = 60 # Seconds
DEFAULT_MAX_RETRIES = 3 # Requests
DEFAULT_SERIALIZER_CLASS = Serializer::MultiJson
- SANITIZED_PASSWORD = '*'*rand(15)
+ SANITIZED_PASSWORD = '*' * (rand(14)+1)
attr_reader :hosts, :options, :connections, :counter, :last_request_at, :protocol
attr_accessor :serializer, :sniffer, :logger, :tracer,
:reload_connections, :reload_after,
:resurrect_after, :max_retries
@@ -31,9 +31,11 @@
def initialize(arguments={}, &block)
@state_mutex = Mutex.new
@hosts = arguments[:hosts] || []
@options = arguments[:options] || {}
+ @options[:http] ||= {}
+
@block = block
@connections = __build_connections
@serializer = options[:serializer] || ( options[:serializer_class] ? options[:serializer_class].new(self) : DEFAULT_SERIALIZER_CLASS.new(self) )
@protocol = options[:protocol] || DEFAULT_PROTOCOL