Skip to content

Conversation

@jsrobson10
Copy link

@jsrobson10 jsrobson10 commented Jun 7, 2025

Fixes

Changes

These changes allow the chunked_threshold value in tiny-http to be overridden per request.

This was achieved by adding an extra field to RequestData. I would have liked to add it to Request instead, but RequestData has private fields which means the changes could be made without causing downstream breakage.

Examples

Force the Content-Length header to always be used:

ResponseBody::from_reader_and_size(reader, buff.len())
    .with_chunked_threshold(usize::max_value())

@jsrobson10
Copy link
Author

I've just merged the upstream changes into this PR and verified that all tests still pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant