Skip to content

Failure to decode header block results in error #16

Description

@CrowdHailer

Hi,
I'm running h2spec against a server implementation I have that is using this library. One of the tests in there (HPACK/5.2 - 3: Sends a Huffman-encoded string literal representation containing the EOS symbol) sends a header_block that causes an error to be raised rather than the library returning an :error tuple.

The following code execution will reproduce it

# iex(2)> header_block = <<130, 135, 132, 65, 138, 8, 157, 92, 11, 129, 112, 220, 121, 166, 153, 0, 133,
  242, 178, 74, 135, 255, 255, 255, 253, 37, 66, 127>>
<<130, 135, 132, 65, 138, 8, 157, 92, 11, 129, 112, 220, 121, 166, 153, 0, 133,
  242, 178, 74, 135, 255, 255, 255, 253, 37, 66, 127>>
# iex(3)> decode_context = :hpack.new_context(1_000) 
{:hpack_context, {:dynamic_table, [], 4096, 0}, 1000}
# iex(4)> :hpack.decode(header_block, decode_context)
** (MatchError) no match of right hand side value: "B\d"
    (hpack) /vagrant/Ace/examples/hello_http2/deps/hpack/src/hpack_string.erl:14: :hpack_string.decode/1
    (hpack) /vagrant/Ace/examples/hello_http2/deps/hpack/src/hpack.erl:188: :hpack.decode_literal_header_without_indexing/3

above is Elixir syntax. I can translate it to erlang if need be but I though would start copying verbatim so no mistakes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions