ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
281 stars 172 forks source link

Ignore client_max_window_bits with missing header #118

Open Kuroneer opened 3 years ago

Kuroneer commented 3 years ago

When the client does not provide the "client_max_window_bits" option, the server must reserve the max size.

Currently, if the server provides the option client_max_window_bits with something less than 15 and a client does not include the option and uses more than the unknown server value, zlib will fail to inflate the payload.

I'll leave this in draft until I'm able to test it.

Are automatic tests for this functionality expected in cowboy?

Kuroneer commented 3 years ago

The only error in the gh actions is Error: Couldn't produce an instance that satisfies all strict constraints from (cow_http_hd:content_range/0) after 50 tries.

I have tested it successfully both manually with a python client and within cowboy test suites.

essen commented 3 years ago

You can run make ct-ws_autobahn in Cowboy to run full tests related to the protocol. make ct-ws for the other ones (this is likely where one test would sit for this).

I don't think this is the right fix what it's worth. This setting on the server indicates that the server doesn't want to accept windows larger than a certain size. I believe the correct behavior when that happens is to return ignore instead.

Kuroneer commented 3 years ago

(force pushed to remove the previous commit from the history and fix the message)

Kuroneer commented 3 years ago

@essen Is there anythin else you'd like to see changed?

essen commented 3 years ago

I just need to find the time to review and test.