mirror of
https://github.com/oven-sh/setup-bun.git
synced 2026-05-19 23:00:14 +02:00
* fix: validate cached binary version matches requested version (#146) * fix: fail closed when cached version cannot be verified
This commit is contained in:
@@ -12,6 +12,11 @@ export function getCacheKey(url: string): string {
|
||||
return `bun-${createHash("sha1").update(url).digest("base64")}`;
|
||||
}
|
||||
|
||||
export function extractVersionFromUrl(url: string): string | undefined {
|
||||
const match = url.match(/\/bun-v([^/]+)\//);
|
||||
return match?.[1];
|
||||
}
|
||||
|
||||
export async function request(
|
||||
url: string,
|
||||
init?: RequestInit,
|
||||
|
||||
Reference in New Issue
Block a user