mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-20 04:36:09 +08:00
refactor: pass api_url
through context (#457)
* refactor: pass `api_url` through context * 移除 LinkArgs.HttpReq * pref(alias): 减少不必要下载代理 * 修复bug * net: 支持1并发 分片下载
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/OpenListTeam/OpenList/cmd/flags"
|
||||
@ -90,10 +88,3 @@ func Pluralize(count int, singular, plural string) string {
|
||||
}
|
||||
return plural
|
||||
}
|
||||
|
||||
func GetHttpReq(ctx context.Context) *http.Request {
|
||||
if c, ok := ctx.(*gin.Context); ok {
|
||||
return c.Request
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user