mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
perf: accept gzip, deflate encoding from the registry (#3745)
ref #3738
This commit is contained in:
6
.changeset/loud-peas-yawn.md
Normal file
6
.changeset/loud-peas-yawn.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/fetch": minor
|
||||
"@pnpm/fetching-types": minor
|
||||
---
|
||||
|
||||
New optional option added: compress.
|
||||
6
.changeset/strong-coats-occur.md
Normal file
6
.changeset/strong-coats-occur.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/npm-resolver": patch
|
||||
---
|
||||
|
||||
The metadata file should be requested in compressed state.
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function (
|
||||
const response = await fetch(urlObject, {
|
||||
agent,
|
||||
// if verifying integrity, node-fetch must not decompress
|
||||
compress: false,
|
||||
compress: opts?.compress ?? false,
|
||||
headers,
|
||||
redirect: 'manual',
|
||||
retry: opts?.retry,
|
||||
|
||||
@@ -7,6 +7,7 @@ export type FetchFromRegistry = (
|
||||
url: string,
|
||||
opts?: {
|
||||
authHeaderValue?: string
|
||||
compress?: boolean
|
||||
retry?: RetryTimeoutOptions
|
||||
timeout?: number
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export default async function fromRegistry (
|
||||
try {
|
||||
response = await fetch(uri, {
|
||||
authHeaderValue,
|
||||
compress: true,
|
||||
retry: fetchOpts.retry,
|
||||
timeout: fetchOpts.timeout,
|
||||
}) as RegistryResponse
|
||||
|
||||
Reference in New Issue
Block a user