From 5c42354b015488aad4d73cff47bea1e6eded9703 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Sat, 12 Feb 2022 20:27:38 +0800 Subject: [PATCH] :bug: fix #527 189 upload name contains + --- drivers/189/util.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/189/util.go b/drivers/189/util.go index 9e84f03a..dd79ae76 100644 --- a/drivers/189/util.go +++ b/drivers/189/util.go @@ -115,12 +115,18 @@ func EncodeParam(v url.Values) string { } buf.WriteString(k) buf.WriteByte('=') - buf.WriteString(strings.ReplaceAll(v, "&", "%26")) + buf.WriteString(encode(v)) } } return buf.String() } +func encode(str string) string { + str = strings.ReplaceAll(str, "&", "%26") + str = strings.ReplaceAll(str, "+", "%2B") + return str +} + func AesEncrypt(data, key []byte) []byte { block, _ := aes.NewCipher(key) if block == nil {