mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-16 03:20:21 -07:00
Update to use a centralized fetcher
This commit is contained in:
parent
6adc5135bc
commit
03a205f64b
9 changed files with 169 additions and 128 deletions
|
|
@ -11,6 +11,7 @@ import java.util.zip.ZipEntry
|
|||
import java.util.zip.ZipInputStream
|
||||
import javax.swing.SwingUtilities
|
||||
import KondoKit.pluginmanager.GitLabConfig
|
||||
import KondoKit.network.HttpFetcher
|
||||
|
||||
/**
|
||||
* Manages downloading and installing plugins from GitLab with concurrent support
|
||||
|
|
@ -127,11 +128,12 @@ object PluginDownloadManager {
|
|||
}
|
||||
|
||||
// Create URL connection
|
||||
val connection = url.openConnection() as HttpURLConnection
|
||||
connection.requestMethod = "GET"
|
||||
connection.setRequestProperty("User-Agent", GitLabConfig.CHROME_USER_AGENT)
|
||||
// Add Accept header to avoid 406 errors
|
||||
connection.setRequestProperty("Accept", "*/*")
|
||||
val connection = try {
|
||||
HttpFetcher.openGetConnection(url.toString())
|
||||
} catch (e: Exception) {
|
||||
debugLog("Failed to open connection for plugin: ${plugin.path} with URL: $downloadUrl. Error: ${e.message}")
|
||||
continue
|
||||
}
|
||||
|
||||
debugLog("Connection opened for plugin: ${plugin.path}")
|
||||
debugLog("Request headers - User-Agent: ${connection.getRequestProperty("User-Agent")}")
|
||||
|
|
@ -367,4 +369,4 @@ object PluginDownloadManager {
|
|||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue