From d927bedd7662b1bc2e4923f57317dda334fc0d75 Mon Sep 17 00:00:00 2001 From: sbwml <984419930@qq.com> Date: Sat, 10 Sep 2022 11:37:25 +0800 Subject: [PATCH] alist: add patches from upstream * fix: if use down proxy url --- .../002-fix-if-use-down-proxy-url.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 alist/patches/002-fix-if-use-down-proxy-url.patch diff --git a/alist/patches/002-fix-if-use-down-proxy-url.patch b/alist/patches/002-fix-if-use-down-proxy-url.patch new file mode 100644 index 0000000..30c4445 --- /dev/null +++ b/alist/patches/002-fix-if-use-down-proxy-url.patch @@ -0,0 +1,31 @@ +From 5ad3849bb635b6f339c4d1d5f648882e840c9189 Mon Sep 17 00:00:00 2001 +From: Noah Hsu +Date: Fri, 9 Sep 2022 20:54:11 +0800 +Subject: [PATCH] fix: if use down proxy url + +--- + server/handles/down.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/server/handles/down.go b/server/handles/down.go +index eb9d04a47..bbe0a30b3 100644 +--- a/server/handles/down.go ++++ b/server/handles/down.go +@@ -52,7 +52,7 @@ func Proxy(c *gin.Context) { + downProxyUrl := storage.GetStorage().DownProxyUrl + if downProxyUrl != "" { + _, ok := c.GetQuery("d") +- if ok { ++ if !ok { + URL := fmt.Sprintf("%s%s?sign=%s", + strings.Split(downProxyUrl, "\n")[0], + utils.EncodePath(rawPath, true), +@@ -103,7 +103,7 @@ func shouldProxy(storage driver.Driver, filename string) bool { + // 4. proxy_types + // solution: text_file + shouldProxy() + func canProxy(storage driver.Driver, filename string) bool { +- if storage.Config().MustProxy() || storage.GetStorage().WebProxy { ++ if storage.Config().MustProxy() || storage.GetStorage().WebProxy || storage.GetStorage().WebdavProxy() { + return true + } + if utils.SliceContains(conf.TypesMap[conf.ProxyTypes], utils.Ext(filename)) {