mirror of
https://github.com/azure/setup-helm.git
synced 2026-12-06 12:11:53 +00:00
Potential fix for code scanning alert no. 5: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
206711cbe5
commit
acc4ca70ab
+3
-2
@@ -664,8 +664,9 @@ describe('run.ts', () => {
|
|||||||
stubDownloadChain()
|
stubDownloadChain()
|
||||||
inputs('3.14', '', '', 'https://fallback.tld')
|
inputs('3.14', '', '', 'https://fallback.tld')
|
||||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||||
const url = String(input)
|
const requestUrl = new URL(String(input))
|
||||||
if (url.startsWith(downloadBaseURL)) {
|
const primaryBaseUrl = new URL(downloadBaseURL)
|
||||||
|
if (requestUrl.origin === primaryBaseUrl.origin) {
|
||||||
throw new Error('Primary unavailable')
|
throw new Error('Primary unavailable')
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user