Method: HTTP2Next::Header::EncodingContext#initialize

Defined in:
lib/http/2/next/header/encoding_context.rb

#initialize(options = {}) ⇒ EncodingContext

Initializes compression context with appropriate client/server defaults and maximum size of the dynamic table.

Parameters:

  • options (Hash) (defaults to: {})

    encoding options :table_size Integer maximum dynamic table size in bytes :huffman Symbol :always, :never, :shorter :index Symbol :all, :static, :never



106
107
108
109
110
111
112
113
114
115
116
# File 'lib/http/2/next/header/encoding_context.rb', line 106

def initialize(options = {})
  default_options = {
    huffman: :shorter,
    index: :all,
    table_size: 4096
  }
  @table = []
  @options = default_options.merge(options)
  @limit = @options[:table_size]
  @_table_updated = false
end