mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 11:06:53 +08:00
Only allow download URLs pointing at the official S3 URL (#71)
fixes #52
This commit is contained in:
@@ -142,6 +142,10 @@ export function getDownloadURL(fileInfo, version: string, arch: string): string
|
||||
return `${baseURL}/${getNightlyFileName(arch)}`
|
||||
}
|
||||
|
||||
// Verify that fileInfo.url points at the official Julia download servers
|
||||
if (!fileInfo.url.startsWith('https://julialang-s3.julialang.org/')) {
|
||||
throw new Error(`versions.json points at a download location outside of Julia's download server: ${fileInfo.url}. Aborting for security reasons.`)
|
||||
}
|
||||
return fileInfo.url
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user