This commit is contained in:
Horis
2025-12-05 22:21:58 +08:00
parent ab47e82ec9
commit 444821701f
@@ -322,7 +322,7 @@ interface JsExtensions : JsEncodeUtils {
fun downloadFile(url: String): String {
rhinoContext.ensureActive()
val analyzeUrl = AnalyzeUrl(url, source = getSource(), coroutineContext = context)
val type = UrlUtil.getSuffix(url, analyzeUrl.type)
val type = analyzeUrl.type ?: UrlUtil.getSuffix(url)
val path = FileUtils.getPath(
File(FileUtils.getCachePath()),
"${MD5Utils.md5Encode16(url)}.${type}"