Skip to content

fix(runtime): reject non-origin proxy URLs - #386

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-380-proxy-origin-validation
Oct 14, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-380-proxy-origin-validation

Conversation

@StepenkoAnatoli

Copy link
Copy Markdown
Owner

Proxy URLs with paths, queries or fragments passed the usability check, so enabling Node environment proxies crashed in Undici and doctor incorrectly reported success. Match Undici's origin rule: a root pathname and no search/hash. Invalid values follow the existing direct-request fallback and named warning; a root trailing slash remains valid.

Fixes #380

what changed: Tightened usableProxyUrl and expanded the existing malformed-proxy, doctor and loopback-fetch regressions.

why: Restore ADR-0047's existing invalid-proxy behavior. The upstream Undici origin parser rejects these URL shapes. No alternative design was set aside.

what it touched: lib/runtime.mjs, proxy/doctor tests, runtime/doctor architecture rows and changelog. No new interface or domain term; the test inventory is unchanged.

what you verified: verified - red-first baseline (91 passed, three expected failures), then passing proxy/runtime regressions and direct assertions for all three URL shapes. The required full suite was accepted by the repository commit gate.

what you got wrong and fixed: mistake - running six full suites concurrently exceeded the default 3900-second budget; where - local commit validation on this Windows host; impact - affected hooks refused commits before publication; cause - excess concurrent subprocess and filesystem work; fix - retry one commit at a time with the ADR-0142 timeout extension (RESEARCH_KIT_GATE_TIMEOUT=7920); verified - the required full-suite commit gate accepted the commit.

Full-suite detail: verified - 1777 passed, 0 failed, 12 unsupported capabilities on win32/Node 24.20.0 in 1581.4 seconds. The gate's documented local unsupported-capability opt-in was used; CI exercises its supported platforms separately.

what changed: Require a root pathname, no search and no fragment in usableProxyUrl; extend proxy and doctor regressions, including a loopback-only fetch that must still go direct.

why: Undici parseOrigin refuses those URL shapes, so auto-enabling them crashes Node fetch and doctor incorrectly reports success. Restore the existing invalid-proxy path (ADR-0047); no alternative design was set aside.

what it touched: runtime.mjs, proxy.test.mjs, doctor.test.mjs, runtime/doctor architecture rows and CHANGELOG.md. No new interface or domain term.

what you verified: verified - red-first runtime assertion and doctor regression. Targeted proxy/runtime/doctor checks and the required full suite run before commit acceptance.

what you got wrong and fixed: mistake - running six full suites concurrently exceeded the default 3900-second budget; where - local commit validation on this Windows host; impact - affected hooks refused commits before publication; cause - excess concurrent subprocess and filesystem work; fix - retry one commit at a time with the ADR-0142 timeout extension (RESEARCH_KIT_GATE_TIMEOUT=7920); verified - the required full-suite commit gate accepted the commit.
@StepenkoAnatoli
StepenkoAnatoli merged commit 0dc3ff0 into main Oct 14, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/issue-380-proxy-origin-validation branch October 14, 2026 18:56
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.

A proxy URL with a path, query or fragment passes usableProxyUrl, so every fetching command crashes with undici's raw 'invalid url' and doctor says pass

1 participant