Update the useragent of the old http client to pass cache version

This commit is contained in:
Bassem Dghaidi authored and GitHub committed 2024-11-27 05:50:01 -08:00
1 parent 82befd3a8f
commit f1aa7811eb
2 files changed
+5 -8

No files matched your search

+2 -5
View File
@@ -161,14 +161,11 @@ async function restoreCacheV1(
)
core.debug(`Archive Path: ${archivePath}`)
// Download the cache archive from from blob storage
// Download the cache from the cache entry
await cacheHttpClient.downloadCache(
cacheEntry.archiveLocation,
archivePath,
options ||
({
timeoutInMs: 30000
} as DownloadOptions)
options
)
if (core.isDebug()) {
+3 -3
View File
@@ -34,6 +34,7 @@ import {
retryTypedResponse
} from './requestUtils'
import { getCacheServiceURL } from './config'
import { getUserAgentString } from './shared/user-agent'
function getCacheApiUrl(resource: string): string {
const baseUrl: string = getCacheServiceURL()
@@ -65,7 +66,7 @@ function createHttpClient(): HttpClient {
const bearerCredentialHandler = new BearerCredentialHandler(token)
return new HttpClient(
'actions/cache',
getUserAgentString(),
[bearerCredentialHandler],
getRequestOptions()
)
@@ -216,8 +217,7 @@ async function uploadChunk(
end: number
): Promise<void> {
core.debug(
`Uploading chunk of size ${
end - start + 1
`Uploading chunk of size ${end - start + 1
} bytes at offset ${start} with content range: ${getContentRange(
start,
end