From 786e44d1d25a0e06f794e89e15769e9fbc96d3b1 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Wed, 29 Jun 2022 20:07:33 +0800 Subject: [PATCH] fix: init aria2 client --- internal/aria2/aria2.go | 4 ++-- server/controllers/aria2.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/aria2/aria2.go b/internal/aria2/aria2.go index ccf41f79..f96d2d24 100644 --- a/internal/aria2/aria2.go +++ b/internal/aria2/aria2.go @@ -26,11 +26,11 @@ func InitAria2Client(uri string, secret string, timeout int) error { if err != nil { return errors.Wrap(err, "failed to init aria2 client") } - client = c - version, err := client.GetVersion() + version, err := c.GetVersion() if err != nil { return errors.Wrapf(err, "failed get aria2 version") } + client = c log.Infof("using aria2 version: %s", version.Version) return nil } diff --git a/server/controllers/aria2.go b/server/controllers/aria2.go index 91241173..bb0971e7 100644 --- a/server/controllers/aria2.go +++ b/server/controllers/aria2.go @@ -11,8 +11,8 @@ import ( ) type SetAria2Req struct { - Uri string `json:"uri"` - Secret string `json:"secret"` + Uri string `json:"uri" form:"uri"` + Secret string `json:"secret" form:"secret"` } func SetAria2(c *gin.Context) {