ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

Make HPACK encode respect new configured max size #106

Closed zuiderkwast closed 3 years ago

zuiderkwast commented 3 years ago

Correction to cow_hpack:encode/2,3 according to RFC 7541, 4.3. Entry Eviction When Dynamic Table Size Changes.

This change also corrects the handling of inserting entries larger than the max size, which shall result in an empty table, according to 4.4. in the same RFC.

Fixes #101, #103.

The test case is taken from a comment by @blaxmirror in #101 and the solution is inspired by those comments as well.

zuiderkwast commented 3 years ago

@essen, I assume you're looking over PRs such as this one sooner or later. It would be good to have it in the next versions of cowboy and gun. It's a plain bug fix.

essen commented 3 years ago

Yes I'm currently catching up on PRs starting with Gun then Cowboy then Cowlib. I will need to create a new Cowlib version as part of my current work on Gun so this will be included.

essen commented 3 years ago

Merged, thanks!