hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.36k stars 272 forks source link

Add a setter for `header_table_size` #637

Closed 4JX closed 11 months ago

4JX commented 2 years ago

I'd like to make a PR to uncomment the setter for header_table_size, found here: https://github.com/hyperium/h2/blob/87969c1f296173a7838956165014b4828dc5d5db/src/frame/settings.rs#L124-L128

When playing around with the setter I found out that connections would sometimes fail the following check, Since the decoder's size is never updated from the default DEFAULT_SETTINGS_HEADER_TABLE_SIZE. https://github.com/hyperium/h2/blob/88b078925416d9d220b69d66192f7be63457d6b8/src/hpack/decoder.rs#L256-L258

Would this be the place to fix that?

seanmonstar commented 2 years ago

What would adding the setter do? The frames aren't part of any public API, so a user couldn't do anything with function. Is there something extra that h2 should be doing? What's the underlying problem you're trying to solve?

4JX commented 2 years ago

The frames aren't part of any public API, so a user couldn't do anything with function.

I'd want to expose that option through h2::client::Builder, the same way max_concurrent_streams and others are.

What's the underlying problem you're trying to solve?

I'm doing some research into HTTP2 based fingerprinting. Its mostly about the flexibility of being able to set that value at will. (And also other things, which would not really matter for the average user)

I understand that adding something like this may not be in the scope of the project.

seanmonstar commented 2 years ago

I'd want to expose that option through h2::client::Builder, the same way max_concurrent_streams and others are.

That seems fair!