Skip to content

fix(network): decode, bound, and cancel shared HTTP requests - #998

Merged
Aayam Bansal (aayambansal) merged 2 commits into
mainfrom
fix/network-response-lifecycle
Oct 18, 2026
Merged

Aayam Bansal (aayambansal) merged 2 commits into
mainfrom
fix/network-response-lifecycle

Conversation

@aayambansal

Copy link
Copy Markdown
Member

The shared network transport could return incomplete buffered responses after cancellation, expose compressed wire bytes, and miss actual byte limits on chunked streams. DNS waits also delayed cancellation, and deterministic address-policy refusals consumed connector retry budgets.

Use one bounded decoding pipeline for buffered and streamed responses, reject incomplete bodies before caching, propagate cancellation through the socket lifetime, and decode gzip/deflate/Brotli before enforcing the byte cap. The Node-to-Web bridge now owns cancellation explicitly so queued data cannot enqueue after a consumer cancels.

Add an explicit OPENSCIENCE_DNS_RESOLVER=cloudflare option for TUN Fake IP environments. Its HTTPS resolver uses a fixed public bootstrap address and TLS hostname verification; returned destination addresses and redirects still pass the existing private-address checks. Default DNS behavior is unchanged. Policy refusals are terminal and the TUN diagnostic explains the supported alternatives without exposing signed download URLs.

Fixes #979, fixes #980, fixes #981, fixes #982, fixes #983.

Validation: 56 focused tests pass through real local HTTP transports, including compression/decoded limits, cancellation, cache exclusion, deferred DNS, policy denial and upstream stream cancellation. Backend typecheck passes. A live pinned DNS-over-HTTPS query returned four public addresses. Existing private/mixed-address and redirect tests pass. No provider credentials or account data changed.

@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openscience Ready Ready Preview Oct 18, 2026 7:32am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 690c85b5 Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant