[Feature] Set a proper User-Agent header on outgoing HTTP request
- I'd be willing to implement this feature (contributing guide)
- This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
As a sys admin, I want package managers to identify themselves with a meaningful User-Agent header, but Yarn 4 currently sends got (https://github.com/sindresorhus/got) instead of identifying itself as Yarn. This makes it impossible to distinguish Yarn traffic and determine it's exact version, preventing us from enforcing package manager (and their versions) allow-lists across the organization.
Describe the solution you'd like
Yarn should send a User-Agent header that identifies itself and the Node.js version on all outgoing HTTP requests, following the convention already established by other package managers:
yarn/4.15.0 node/v22.22.2Describe the drawbacks of your solution
None
Describe alternatives you've considered
The behavior can be replicated via a wrapNetworkRequest plugin. However, this shouldn't require a plugin. Sending a meaningful User-Agent is standard HTTP hygiene already done by npm (npm/x.x.x node/vx.x.x) and pnpm (pnpm/x.x.x).
Source: yarnpkg/berry