From 2f4698450560966bc837849d84574d0a94421a41 Mon Sep 17 00:00:00 2001 From: Joseph Joseph Date: Mon, 18 May 2026 16:08:27 -0400 Subject: [PATCH] fix(cache): ensure trailing slash when joining base URL with API path When ACTIONS_CACHE_URL does not end with a trailing slash, the constructed URL becomes invalid (e.g. 'https://example.com_apis/artifactcache/...' instead of 'https://example.com/_apis/artifactcache/...'). This normalizes the base URL to always include a trailing slash before appending the API path segment. Fixes #2375 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/cache/src/internal/cacheHttpClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheHttpClient.ts b/packages/cache/src/internal/cacheHttpClient.ts index 879d73f079..fd74f6b83a 100644 --- a/packages/cache/src/internal/cacheHttpClient.ts +++ b/packages/cache/src/internal/cacheHttpClient.ts @@ -43,7 +43,7 @@ function getCacheApiUrl(resource: string): string { throw new Error('Cache Service Url not found, unable to restore cache.') } - const url = `${baseUrl}_apis/artifactcache/${resource}` + const url = `${baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`}_apis/artifactcache/${resource}` core.debug(`Resource Url: ${url}`) return url }