Skip to content

Commit

Permalink
fix: Fix useragent prefix trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlaud committed Jul 21, 2020
1 parent af73cb9 commit 640e2ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/request/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const makeSnykRequest = async (request: snykRequest, snykToken: string = '', use
const token = snykToken == '' ? userConfig.token : snykToken

let topParentModuleName = getTopParentModuleName(module.parent)

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

const apiClient = axios.create({
Expand Down

0 comments on commit 640e2ae

Please sign in to comment.