@@ -3,6 +3,7 @@ const fetch = require('minipass-fetch')
33const { promiseRetry } = require ( '@gar/promise-retry' )
44const ssri = require ( 'ssri' )
55const { log } = require ( 'proc-log' )
6+ const { redact : cleanUrl } = require ( '@npmcli/redact' )
67
78const CachingMinipassPipeline = require ( './pipeline.js' )
89const { getAgent } = require ( '@npmcli/agent' )
@@ -55,6 +56,7 @@ const remoteFetch = (request, options) => {
5556
5657 return promiseRetry ( async ( retryHandler , attemptNum ) => {
5758 const req = new fetch . Request ( request , _opts )
59+ const url = cleanUrl ( req . url )
5860 try {
5961 let res = await fetch ( req , _opts )
6062 if ( _opts . integrity && res . status === 200 ) {
@@ -92,7 +94,7 @@ const remoteFetch = (request, options) => {
9294 }
9395
9496 /* eslint-disable-next-line max-len */
95- log . http ( 'fetch' , `${ req . method } ${ req . url } attempt ${ attemptNum } failed with ${ res . status } ` )
97+ log . http ( 'fetch' , `${ req . method } ${ url } attempt ${ attemptNum } failed with ${ res . status } ` )
9698 return retryHandler ( res )
9799 }
98100
@@ -116,7 +118,7 @@ const remoteFetch = (request, options) => {
116118 options . onRetry ( err )
117119 }
118120
119- log . http ( 'fetch' , `${ req . method } ${ req . url } attempt ${ attemptNum } failed with ${ err . code } ` )
121+ log . http ( 'fetch' , `${ req . method } ${ url } attempt ${ attemptNum } failed with ${ err . code } ` )
120122 return retryHandler ( err )
121123 }
122124 } , options . retry ) . catch ( ( err ) => {
0 commit comments