Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/utils/audit-error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const log = require('./log-shim')
const replaceInfo = require('./replace-info.js')

// print an error or just nothing if the audit report has an error
// this is called by the audit command, and by the reify-output util
Expand All @@ -24,7 +25,7 @@ const auditError = (npm, report) => {
npm.output(JSON.stringify({
message: error.message,
method: error.method,
uri: error.uri,
uri: replaceInfo(error.uri),
headers: error.headers,
statusCode: error.statusCode,
body,
Expand Down
4 changes: 2 additions & 2 deletions test/lib/utils/audit-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ t.test('error, audit command, json', async t => {
message: 'message',
body: { response: 'body' },
method: 'POST',
uri: 'https://example.com/not/a/registry',
uri: 'https://username:password@example.com/not/a/registry',
headers: {
head: ['ers'],
},
Expand All @@ -101,7 +101,7 @@ t.test('error, audit command, json', async t => {
'{\n' +
' "message": "message",\n' +
' "method": "POST",\n' +
' "uri": "https://example.com/not/a/registry",\n' +
' "uri": "https://username:***@example.com/not/a/registry",\n' +
' "headers": {\n' +
' "head": [\n' +
' "ers"\n' +
Expand Down