File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const getTokenFromOneTimeToken = async (
5757 log ( `Requesting CMA Token with given App Token` )
5858
5959 const requestor = makeRequest (
60- `/ spaces/${ spaceId } /environments/${ environmentId } /app_installations/${ appInstallationId } /access_tokens` ,
60+ `spaces/${ spaceId } /environments/${ environmentId } /app_installations/${ appInstallationId } /access_tokens` ,
6161 {
6262 method : 'POST' ,
6363 headers : {
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ export const makeRequest = (
2121 fetchOptions : FetchOptions ,
2222) : Requestor => {
2323 return async ( ) : Promise < Response > => {
24- const response = await fetch ( `${ fetchOptions . prefixUrl } ${ url } ` , options )
24+ const prefixWithSlash = fetchOptions . prefixUrl . endsWith ( '/' )
25+ ? fetchOptions . prefixUrl
26+ : `${ fetchOptions . prefixUrl } /`
27+ const response = await fetch ( `${ prefixWithSlash } ${ url } ` , options )
2528 if ( ! response . ok ) {
2629 throw new HttpError ( response )
2730 }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const cleanOldKeys = async () => {
1010 const appDefinitionId = process . env . APP_ID
1111
1212 const requestor = makeRequest (
13- `/ organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys` ,
13+ `organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys` ,
1414 {
1515 method : 'GET' ,
1616 headers : {
@@ -27,7 +27,7 @@ export const cleanOldKeys = async () => {
2727
2828 const deleteKeysRequests = fingerprints . map ( ( fingerprint : string ) => {
2929 const requestor = makeRequest (
30- `/ organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys/${ fingerprint } ` ,
30+ `organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys/${ fingerprint } ` ,
3131 {
3232 method : 'DELETE' ,
3333 headers : {
@@ -48,7 +48,7 @@ export const setPublicKey = async (publicKey: Buffer) => {
4848 const keyId = base64url ( crypto . createHash ( 'sha256' ) . update ( publicKey ) . digest ( ) )
4949
5050 const requestor = makeRequest (
51- `/ organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys` ,
51+ `organizations/${ organizationId } /app_definitions/${ appDefinitionId } /keys` ,
5252 {
5353 method : 'POST' ,
5454 headers : {
You can’t perform that action at this time.
0 commit comments