fix results url construction

This commit is contained in:
Rob Herley authored and GitHub committed 2023-11-20 18:06:44 +00:00
1 parent 420a520de3
commit 8262f2cbe7
2 files changed
+4 -3

No files matched your search

+2 -2
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
}
+2 -1
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 {