Skip to content

v0.4.1

Choose a tag to compare

@physics515 physics515 released this 24 Sep 20:07
992ae77

Patch release. One consumer-visible fix; the rest is documentation and CI hardening.

Fixed

A non-UTF-8 header value no longer panics when a Response is serialized.

UpstreamResponse and UpstreamRequest built their header maps with value.to_str().unwrap(). HeaderValue::to_str rejects anything that is not visible ASCII, but RFC 9110 permits opaque octets (obs-text) in a field value — so a server could panic the caller's task simply by sending one. Because the panic was inside a Serialize impl, it was reachable from json!(response) or any other serialization of a Response.

Header values are now decoded with String::from_utf8_lossy, matching how the response body was already handled: an unusual or hostile header degrades to replacement characters instead of unwinding. Covered by a regression test per impl.

If you serialize Response values and talk to servers you do not control, this is worth taking.

Documentation

All seven doc examples were broken and nothing was running them — CI used cargo test --lib, which skips doctests entirely.

  • Response::from_json and Response::request_from_json called post with three arguments against its four-argument signature.
  • Response::body tried to Display a &[u8].
  • The ws example was stale against tokio-tungstenite 0.29, where Message::Text takes Utf8Bytes rather than String and into_data() returns Bytes rather than Vec<u8>. The same stale snippet in the README is corrected too — so the websocket example on the front page now reflects the API you actually get.

All seven are now marked no_run: type-checked on every build, never executed. CI gained a cargo test --doc step so they cannot rot unnoticed again.

Internal

quinn-proto bumped to 0.11.18 in Cargo.lock for a RUSTSEC advisory. Lockfile-only — it is not reachable in the built dependency graph, and a library's lockfile does not bind its dependents, so this has no effect on consumers.

Unchanged

No API changes. The live Tor request path is untouched.

Full detail: #8