1
0
Fork 0

fix results url construction

pull/1584/head
Rob Herley 2023-11-20 18:06:44 +00:00 committed by GitHub
parent 9e7201ff5b
commit a920781ca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -52,8 +52,8 @@ class ArtifactHttpClient implements Rpc {
contentType: 'application/json' | 'application/protobuf',
data: object | Uint8Array
): Promise<object | Uint8Array> {
const url = `${this.baseUrl}/twirp/${service}/${method}`
debug(`Requesting ${url}`)
const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href
debug(`Requesting: ${url}`)
const headers = {
'Content-Type': contentType
}

View File

@ -19,7 +19,8 @@ export function getResultsServiceUrl(): string {
if (!resultsUrl) {
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable')
}
return resultsUrl
return new URL(resultsUrl).origin
}
export function isGhes(): boolean {