lib/protocol/hpack/context.rb in protocol-hpack-1.4.0 vs lib/protocol/hpack/context.rb in protocol-hpack-1.4.1

- old
+ new

@@ -301,16 +301,18 @@ @table.inject(0) {|r, (k, v)| r + k.bytesize + v.bytesize + 32} end private - # Add a name-value pair to the dynamic table. - # Older entries might have been evicted so that - # the new entry fits in the dynamic table. + # Add a name-value pair to the dynamic table. Older entries might have been evicted so that the new entry fits in the dynamic table. The command and the component strings will be frozen. # # @param command [Array] +[name, value]+ def add_to_table(command) return unless size_check(command) + + command.each(&:freeze) + command.freeze + @table.unshift(command) end # To keep the dynamic table size lower than or equal to @table_size, # remove one or more entries at the end of the dynamic table.