Skip to content

Commit

Permalink
support: further sanitize contributor data
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Sep 6, 2019
1 parent 9415ba0 commit 6f944dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,23 @@ function downloadSupportData (supportablePackages, cb) {
})
}
contributorData.url = contributor.url
done(null, contributorData)
var result = {
name: contributorData.name,
type: contributorData.type,
url: contributor.url
}
if (looksLikeURL(contributorData.homepage)) {
result.homepage = contributorData.homepage
}
if (
Array.isArray(contributorData.links) &&
contributorData.links.every(function (element) {
return looksLikeURL(element)
})
) {
result.links = contributorData.links
}
done(null, result)
})
}
}), 5, function (error, resolvedContributors) {
Expand Down

0 comments on commit 6f944dd

Please sign in to comment.