Skip to content

Commit 6ca9eff

Browse files
conspicuousClockworkKeen Yee Liau
authored andcommitted
feat(@schematics/update): import user-agent from NPM config
Configuration of the user-agent header in requests is a commonly available feature; previous versions of angular-cli do not pull this value from NPM.
1 parent 4cca3a1 commit 6ca9eff

File tree

1 file changed

+3
-0
lines changed
  • packages/schematics/update/update

1 file changed

+3
-0
lines changed

packages/schematics/update/update/npm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export function getNpmPackageJson(
195195
getNpmConfigOption('strict-ssl'),
196196
getNpmConfigOption('cafile'),
197197
getNpmConfigOption('_auth'),
198+
getNpmConfigOption('user-agent'),
198199
getNpmConfigOption('_authToken', registryKey),
199200
getNpmConfigOption('username', registryKey, true),
200201
getNpmConfigOption('password', registryKey, true),
@@ -209,6 +210,7 @@ export function getNpmPackageJson(
209210
strictSsl,
210211
cafile,
211212
token,
213+
userAgent,
212214
authToken,
213215
username,
214216
password,
@@ -264,6 +266,7 @@ export function getNpmPackageJson(
264266
const client = new RegistryClient({
265267
proxy: { http, https },
266268
ssl: sslOptions,
269+
...(userAgent && {userAgent: userAgent}),
267270
});
268271
client.log.level = 'silent';
269272
const params = {

0 commit comments

Comments
 (0)