fix: rename strictSSL to strictSsl in all places (#3494)

close #3493
This commit is contained in:
Zoltan Kochan
2021-06-02 02:27:44 +03:00
committed by GitHub
parent e7d9cd187a
commit eeff424bd1
5 changed files with 15 additions and 8 deletions

View File

@@ -0,0 +1,7 @@
---
"@pnpm/fetch": major
"@pnpm/npm-registry-agent": major
"@pnpm/client": major
---
strictSSL option renamed to strictSsl.

View File

@@ -34,7 +34,7 @@ export default function (
const agent = npmRegistryAgent(urlObject.href, {
...defaultOpts,
...opts,
strictSSL: defaultOpts.strictSSL ?? true,
strictSsl: defaultOpts.strictSsl ?? true,
} as any) // eslint-disable-line
headers['connection'] = agent ? 'keep-alive' : 'close'

View File

@@ -20,7 +20,7 @@ export interface AgentOptions {
localAddress?: string
maxSockets?: number
noProxy?: boolean | string
strictSSL?: boolean
strictSsl?: boolean
timeout?: number
}
@@ -36,7 +36,7 @@ export default function getAgent (uri: string, opts: AgentOptions) {
? `proxy:${pxuri.protocol}//${pxuri.host}:${pxuri.port}`
: '>no-proxy<',
`local-address:${opts.localAddress ?? '>no-local-address<'}`,
`strict-ssl:${isHttps ? Boolean(opts.strictSSL).toString() : '>no-strict-ssl<'}`,
`strict-ssl:${isHttps ? Boolean(opts.strictSsl).toString() : '>no-strict-ssl<'}`,
`ca:${(isHttps && opts.ca) || '>no-ca<'}`,
`cert:${(isHttps && opts.cert) || '>no-cert<'}`,
`key:${(isHttps && opts.key) || '>no-key<'}`,
@@ -67,7 +67,7 @@ export default function getAgent (uri: string, opts: AgentOptions) {
key: opts.key,
localAddress: opts.localAddress,
maxSockets: opts.maxSockets ?? DEFAULT_MAX_SOCKETS,
rejectUnauthorized: opts.strictSSL,
rejectUnauthorized: opts.strictSsl,
timeout: agentTimeout,
} as any) // eslint-disable-line @typescript-eslint/no-explicit-any
: new HttpAgent({
@@ -143,7 +143,7 @@ function getProxy (
timeout?: number
localAddress?: string
maxSockets?: number
strictSSL?: boolean
strictSsl?: boolean
},
isHttps: boolean
) {
@@ -158,7 +158,7 @@ function getProxy (
path: proxyUrl.pathname,
port: proxyUrl.port,
protocol: proxyUrl.protocol,
rejectUnauthorized: opts.strictSSL,
rejectUnauthorized: opts.strictSsl,
timeout: typeof opts.timeout !== 'number' || opts.timeout === 0 ? 0 : opts.timeout + 1,
}

View File

@@ -25,7 +25,7 @@ const OPTS = {
key: 'key',
localAddress: 'localAddress',
maxSockets: 5,
strictSSL: true,
strictSsl: true,
timeout: 5,
}

View File

@@ -57,7 +57,7 @@ export default async (
retries: opts.fetchRetries,
},
storeDir: opts.storeDir,
strictSSL: opts.strictSsl ?? true,
strictSsl: opts.strictSsl ?? true,
timeout: opts.fetchTimeout,
userAgent: opts.userAgent,
maxSockets: opts.networkConcurrency != null