From 640e2ae248fa80a87fd96a9db988ec938c7385af Mon Sep 17 00:00:00 2001 From: aarlaud Date: Tue, 21 Jul 2020 15:32:20 +0200 Subject: [PATCH] fix: Fix useragent prefix trailing slash --- src/lib/request/request.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/request/request.ts b/src/lib/request/request.ts index 6ca8cdc..978731a 100644 --- a/src/lib/request/request.ts +++ b/src/lib/request/request.ts @@ -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({