Skip to content

Commit

Permalink
fix: package.json to reduce vulnerabilities
Browse files Browse the repository at this point in the history
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AXIOS-1038255
  • Loading branch information
snyk-bot authored and lili2311 committed Jan 11, 2021
1 parent 972d9e0 commit ce5a88d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@snyk/configstore": "^3.2.0-rc1",
"@types/uuid": "^7.0.3",
"axios": "^0.20.0",
"axios": "^0.21.1",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"leaky-bucket-queue": "0.0.2",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/request/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const getTopParentModuleName = (parent: NodeModule | null): string => {
const makeSnykRequest = async (request: snykRequest, snykToken: string = '', userAgentPrefix:string = '') => {
const userConfig = getConfig()
const token = snykToken == '' ? userConfig.token : snykToken
let topParentModuleName = getTopParentModuleName(module.parent)

let topParentModuleName = getTopParentModuleName(module.parent as any)
const userAgentPrefixChecked = userAgentPrefix != '' && !userAgentPrefix.endsWith('/') ? userAgentPrefix+'/': userAgentPrefix
const requestHeaders: Object = {
'Content-Type': 'application/json',
'Authorization': 'token '+ token,
'User-Agent': `${topParentModuleName}${userAgentPrefixChecked}tech-services/snyk-request-manager/1.0`
}

const apiClient = axios.create({
baseURL: userConfig.endpoint,
responseType: 'json',
Expand Down

0 comments on commit ce5a88d

Please sign in to comment.