Summary
docs/features/compression.md documents compression.minBodyBytes as default 1 KB, but the actual default in the Rust core is 512 bytes (crates/iroh-http-core/src/config.rs — min_body_bytes: usize with Default: 512). Fix the doc to match the code (or change the code if 1 KB is intended).
Evidence
- Doc (
docs/features/compression.md line 19): minBodyBytes: 1024, // skip compression below this size (default 1 KB)
- Code (
crates/iroh-http-core/src/config.rs): default constant is 512.
- The Node FFI bridge (
packages/iroh-http-node/src/lib.rs line 420) also defaults to 512 when compressionMinBodyBytes is None.
Impact
Cosmetic: developers tuning compression behaviour read the doc, expect compression to skip bodies below 1 KB, and instead see compression on bodies between 512 B and 1 KB.
Remediation
Two options — pick one:
- Fix the doc to say
default 512 bytes (lowest-friction).
- Change the default to 1 KB in
config.rs and the Node bridge (matches the convention used by most HTTP servers; the tower-http SizeAbove predicate's built-in default is 32 but most servers tune higher).
Acceptance criteria
- Documented default and code default agree.
- A
CompressionOptions::default() test asserts the value (regression guard).
Summary
docs/features/compression.mddocumentscompression.minBodyBytesasdefault 1 KB, but the actual default in the Rust core is 512 bytes (crates/iroh-http-core/src/config.rs—min_body_bytes: usizewithDefault: 512). Fix the doc to match the code (or change the code if 1 KB is intended).Evidence
docs/features/compression.mdline 19):minBodyBytes: 1024, // skip compression below this size (default 1 KB)crates/iroh-http-core/src/config.rs): default constant is512.packages/iroh-http-node/src/lib.rsline 420) also defaults to512whencompressionMinBodyBytesisNone.Impact
Cosmetic: developers tuning compression behaviour read the doc, expect compression to skip bodies below 1 KB, and instead see compression on bodies between 512 B and 1 KB.
Remediation
Two options — pick one:
default 512 bytes(lowest-friction).config.rsand the Node bridge (matches the convention used by most HTTP servers; the tower-httpSizeAbovepredicate's built-in default is 32 but most servers tune higher).Acceptance criteria
CompressionOptions::default()test asserts the value (regression guard).