Skip to content

Commit

Permalink
core(audit): add utm parameters when calling snyk (#6172)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviadatsnyk authored and paulirish committed Oct 4, 2018
1 parent fbcb1e3 commit bbd87a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class NoVulnerableLibrariesAudit extends Audit {
vulnCount,
detectedLib: {
text: lib.name + '@' + version,
url: `https://snyk.io/vuln/npm:${lib.npmPkgName}?lh=${version}`,
url: `https://snyk.io/vuln/npm:${lib.npmPkgName}?lh=${version}&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit`,
type: 'link',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Avoids front-end JavaScript libraries with known vulnerabilities', ()
assert.equal(auditResult.details.items[0].highestSeverity, 'High');
assert.equal(auditResult.details.items[0].detectedLib.type, 'link');
assert.equal(auditResult.details.items[0].detectedLib.text, '[email protected]');
assert.equal(auditResult.details.items[0].detectedLib.url, 'https://snyk.io/vuln/npm:angular?lh=1.1.4');
assert.equal(auditResult.details.items[0].detectedLib.url, 'https://snyk.io/vuln/npm:angular?lh=1.1.4&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit');
});

it('handles ill-specified versions', () => {
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,7 @@
"vulnCount": 1,
"detectedLib": {
"text": "[email protected]",
"url": "https://snyk.io/vuln/npm:jquery?lh=2.1.1",
"url": "https://snyk.io/vuln/npm:jquery?lh=2.1.1&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit",
"type": "link"
}
}
Expand Down

0 comments on commit bbd87a3

Please sign in to comment.