Files
pnpm/network/fetch/src/index.ts
Zoltan Kochan 20e7affbe2 fix: publish web-auth honors proxy when polling doneUrl (#11581)
- `pnpm publish` failed to complete the web-based authentication flow when an HTTP/HTTPS proxy was configured. `libnpmpublish` (used for the initial publish request) routes through the proxy, but the subsequent `doneUrl` polling went through `@pnpm/network.fetch` without forwarding any proxy/TLS settings. The registry rejected the poll with `403` because the source IP differed from the initial request, so publish hung on the QR-code prompt forever.
- Adds `createDispatchedFetch(opts)` to `@pnpm/network.fetch` — a curried `fetchWithDispatcher` that pre-binds proxy / TLS / local-address / `configByUri`-derived client certificates. `publishPackedPkg` uses it to build an `OtpContext` whose `fetch` honors the same network configuration as the publish request.
- `extractTlsConfigs` is now performed automatically inside `createDispatchedFetch` (and hoisted out of the per-request loop in `createFetchFromRegistry`), so callers only have to pass `configByUri` once.

Fixes #11561.
2026-05-11 16:22:25 +02:00

5 lines
410 B
TypeScript

export { clearDispatcherCache, getDispatcher } from './dispatcher.js'
export { fetch, isRedirect, type RetryTimeoutOptions } from './fetch.js'
export { createDispatchedFetch, type CreateDispatchedFetchOptions, createFetchFromRegistry, type CreateFetchFromRegistryOptions, type DispatcherOptions, fetchWithDispatcher } from './fetchFromRegistry.js'
export type { FetchFromRegistry } from '@pnpm/fetching.types'