Skip to content

Commit

Permalink
fix: check replace app. by api. from url
Browse files Browse the repository at this point in the history
  • Loading branch information
mathild3r committed Jul 1, 2022
1 parent 3ba69fc commit d948aad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/request/requestManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit d948aad

Please sign in to comment.