@@ -40,7 +40,6 @@ export async function downloadProxy(version: string) {
4040 const releaseUrl = `https://api.github.com/repos/${ GITHUB_REPO } /releases/tags/${ version } ` ;
4141 const response = await axios . get ( releaseUrl ) ;
4242 const assets = response . data . assets ;
43- logger . info ( `Found ${ assets . length } assets: ${ assets . map ( ( a : any ) => a . name ) . join ( ', ' ) } ` ) ;
4443 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4544 const asset = assets . find ( ( a : any ) => a . name === ASSET_NAME ) ;
4645 // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -93,11 +92,19 @@ export async function downloadProxy(version: string) {
9392 }
9493 logger . info ( 'Checksum verified successfully' ) ;
9594 } catch ( error ) {
96- logger . warn ( 'Checksum verification skipped or failed: ' + error ) ;
97- // Decide if we want to fail hard or warn. For security, failing hard is better if checksum was expected.
98- // But if checksum file is missing, maybe warn.
99- // Given requirements "Secure", let's fail if we found a checksum url but it failed.
100- if ( checksumUrl ) throw error ;
95+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
96+ if ( axios . isAxiosError ( error ) && error . response ?. status === 404 ) {
97+ logger . warn ( 'Checksum file not found, skipping verification.' ) ;
98+ } else {
99+ logger . warn ( 'Checksum verification failed: ' + error ) ;
100+ // If it was a verification failure (not 404), we should probably fail.
101+ // But if it was a network error fetching the checksum, maybe we should also fail?
102+ // For now, if we have a checksum URL and it fails to verify (mismatch), we threw Error above.
103+ // If axios failed with other than 404, we rethrow.
104+ if ( ! ( axios . isAxiosError ( error ) && error . response ?. status === 404 ) ) {
105+ throw error ;
106+ }
107+ }
101108 }
102109 }
103110
0 commit comments