From d948aadda95d73a36bfaeeb9283867d6cd662f4c Mon Sep 17 00:00:00 2001 From: Mathilde Date: Fri, 1 Jul 2022 13:15:40 +0100 Subject: [PATCH] fix: check replace app. by api. from url --- src/lib/request/requestManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/request/requestManager.ts b/src/lib/request/requestManager.ts index fd1c591..7645d6e 100644 --- a/src/lib/request/requestManager.ts +++ b/src/lib/request/requestManager.ts @@ -36,8 +36,9 @@ interface RequestsManagerParams { } function getRESTAPI(endpoint: string): string { - const apiData = new URL(endpoint); // e.g 'https://api.snyk.io/rest/' + const apiData = new URL(endpoint.replace('app.', '')); + return new URL(`${apiData.protocol}//api.${apiData.host}/rest`).toString(); }