Skip to content

v0.1.2

Choose a tag to compare

@dbowm91 dbowm91 released this 11 Sep 20:43
· 204 commits to main since this release

Added

  • Python request.extensions accepts typed keys target (str or bytes), sni_hostname (str), and trace (callable). These are extracted once by extract_native_extensions into eggfetch_core::TransportHints before dispatch. Unknown keys are passed through to the HTTPX compatibility facade.
  • Native PyTraceObserver (in crates/eggfetch-python/src/trace_bridge.rs) bridges Python callables into eggfetch_core::trace::TraceObserver so callables never enter the core crate. Sync callbacks work on both Client and AsyncClient; coroutine callbacks (detected via inspect.iscoroutinefunction) are rejected with TypeError before dispatch on both APIs because the core TraceObserver is synchronous.
  • Response.extensions and StreamingResponse.extensions properties expose {http_version, reason_phrase, network_stream} snapshots of the wire state.
  • NetworkStream (sync, GIL-released) and AsyncNetworkStream exposed through Response.extensions["network_stream"] for 101 Switching Protocols upgrades. The sync wrapper carries an explicit tokio::runtime::Handle and optional RuntimeLease so it can drive IO without relying on an ambient runtime. Cloning a NetworkStream shares the same underlying Arc<Mutex<>> so the IO is shared, not duplicated. Internal HTTPS CONNECT tunnels are never surfaced as writable NetworkStream (the canonical access path is the body iterator).
  • NetworkStream.start_tls(ssl_context=..., server_hostname=..., timeout=...) uses the same safe TLS translation as the default client. It is rejected for Hyper-opaque Adapter variants and for streams that are already TLS-wrapped; only inner Tcp-variant streams support start_tls.
  • UpgradedStream carries an UpgradedStreamVariant (Tcp/Tls/Adapter) classification so callers can detect start_tls eligibility before any IO is consumed.

Fixed

  • pipeline::send_with_redirects redirects-disabled fast path now reattaches the original TransportHints to the reconstructed request, so target, sni_hostname, and trace are no longer silently dropped when internal redirect handling is bypassed.
  • Response.reason_phrase prefers wire_reason_phrase() over the canonical lookup table, so responses with non-canonical status-line reason phrases are surfaced truthfully.