mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-07 06:49:55 +00:00
chore: let /upgrade support channel and force as parameters in restful api
Leaving `channel` blank will automatically determine the channel. Other valid values are `alpha`/`release`. Setting `force` to `true` will bypass the version check and force the update.
This commit is contained in:
@@ -32,7 +32,11 @@ func upgradeCore(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
err = updater.DefaultCoreUpdater.Update(execPath)
|
||||
query := r.URL.Query()
|
||||
channel := query.Get("channel")
|
||||
force := query.Get("force") == "true"
|
||||
|
||||
err = updater.DefaultCoreUpdater.Update(execPath, channel, force)
|
||||
if err != nil {
|
||||
log.Warnln("%s", err)
|
||||
render.Status(r, http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user