This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# make-fetch-happen
[![npm version](https://img.shields.io/npm/v/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![license](https://img.shields.io/npm/l/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![Travis](https://img.shields.io/travis/npm/make-fetch-happen.svg)](https://travis-ci.org/npm/make-fetch-happen) [![Coverage Status](https://coveralls.io/repos/github/npm/make-fetch-happen/badge.svg?branch=latest)](https://coveralls.io/github/npm/make-fetch-happen?branch=latest)
[![npm version](https://img.shields.io/npm/v/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![license](https://img.shields.io/npm/l/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![Coverage Status](https://coveralls.io/repos/github/npm/make-fetch-happen/badge.svg?branch=latest)](https://coveralls.io/github/npm/make-fetch-happen?branch=latest)
[`make-fetch-happen`](https://github.com/npm/make-fetch-happen) is a Node.js
library that wraps [`minipass-fetch`](https://github.com/npm/minipass-fetch) with additional
+4 -2
View File
@@ -3,6 +3,7 @@ const fetch = require('minipass-fetch')
const { promiseRetry } = require('@gar/promise-retry')
const ssri = require('ssri')
const { log } = require('proc-log')
const { redact: cleanUrl } = require('@npmcli/redact')
const CachingMinipassPipeline = require('./pipeline.js')
const { getAgent } = require('@npmcli/agent')
@@ -55,6 +56,7 @@ const remoteFetch = (request, options) => {
return promiseRetry(async (retryHandler, attemptNum) => {
const req = new fetch.Request(request, _opts)
const url = cleanUrl(req.url)
try {
let res = await fetch(req, _opts)
if (_opts.integrity && res.status === 200) {
@@ -92,7 +94,7 @@ const remoteFetch = (request, options) => {
}
/* eslint-disable-next-line max-len */
log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${res.status}`)
log.http('fetch', `${req.method} ${url} attempt ${attemptNum} failed with ${res.status}`)
return retryHandler(res)
}
@@ -116,7 +118,7 @@ const remoteFetch = (request, options) => {
options.onRetry(err)
}
log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${err.code}`)
log.http('fetch', `${req.method} ${url} attempt ${attemptNum} failed with ${err.code}`)
return retryHandler(err)
}
}, options.retry).catch((err) => {
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "make-fetch-happen",
"version": "15.0.4",
"version": "15.0.6",
"description": "Opinionated, caching, retrying fetch client",
"main": "lib/index.js",
"files": [
@@ -35,6 +35,7 @@
"dependencies": {
"@gar/promise-retry": "^1.0.0",
"@npmcli/agent": "^4.0.0",
"@npmcli/redact": "^4.0.0",
"cacache": "^20.0.1",
"http-cache-semantics": "^4.1.1",
"minipass": "^7.0.2",