Repository navigation
Conversation
Replace the ignored agent option with an Undici proxy dispatcher. Close each dispatcher gracefully without blocking response body consumption. Add real CONNECT proxy regressions for uploads, polling, downloads, credentials and failure behavior. Fixes mozilla#3413 Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3413.
The signing client passes
https-proxy-agentusing theagentoption, which native Node fetch ignores. As a result,web-ext sign --api-proxy ...sends requests directly instead of through the requested proxy. This affects uploads, validation/approval polling, source patches, and signed-file downloads.Use Undici's
ProxyAgentvia the supporteddispatcheroption. Replace the unusedhttps-proxy-agentdependency with Undici 6, which supports the existing Node >=20.0.0 engine range. The lockfile retains Cheerio's existing Undici 7 version under its own dependency tree.Each request closes its dispatcher gracefully once the response body is consumed. Cleanup is initiated after fetch returns headers without awaiting it, so callers can consume multipart responses and streamed downloads; failed requests also initiate cleanup. No global dispatcher is changed.
Executed validation
The new tests use real loopback origin and HTTP CONNECT proxy servers, with no external service or real AMO credentials. They check GET polling, JSON PUT, multipart POST/PATCH, chunked binary downloads, URL-encoded proxy credentials, rejection without a direct fallback, and no-proxy requests.
npm test: 589 passed.npm test: 597 passed, including ESLint checks.npm run test-functional: 20 passed, 4 existing pending.npm run buildand Prettier checks: passed.Validated on Node 22.22.0. The transport regressions use HTTP origins and an HTTP CONNECT proxy; they do not exercise a real AMO submission or a live enterprise TLS proxy.
Implementation and test execution were assisted by Codex.