public void TestExceedHeaderSize() { int maxListSize = 100; decoder.Configuration.SetMaxHeaderListSize(maxListSize, maxListSize); var buf = Encode(Http2TestUtil.RandomBytes(maxListSize), Http2TestUtil.RandomBytes(1)); Assert.Throws <Http2Exception>(() => decoder.DecodeHeaders(0, buf)); buf.Release(); }
public void DecodeShouldSucceed() { var buf = Encode(B(":method"), B("GET"), B("akey"), B("avalue"), Http2TestUtil.RandomBytes(), Http2TestUtil.RandomBytes()); try { var headers = decoder.DecodeHeaders(0, buf); Assert.Equal(3, headers.Size); Assert.Equal("GET", headers.Method); Assert.Equal("avalue", headers.Get(new AsciiString("akey"), null)); } finally { buf.Release(); } }