Closed wxy1343 closed 1 year ago
你curl正常吗
你curl正常吗
其它功能都是正常的
root@OpenWrt:~# curl --version
curl 7.86.0 (x86_64-openwrt-linux-gnu) libcurl/7.86.0 mbedTLS/2.28.1 nghttp2/1.44.0
Release-Date: 2022-10-26
Protocols: file ftp ftps http https mqtt
Features: alt-svc HSTS HTTP2 IPv6 Largefile SSL threadsafe
curl -sS -o /dev/null -w %{url_effective} --get --data-urlencode "key=TEST" ""
curl -sS -o /dev/null -w %{url_effective} --get --data-urlencode "key=TEST" ""
curl -sS -o /dev/null -w %{url_effective} "www.baidu.com"
curl -sS -o /dev/null -w %{url_effective} "www.baidu.com"
应该是更新curl后出现的问题,旧版本正常,已测试v7.86.0
出现该问题
https://github.com/vernesong/OpenClash/issues/2799#issue-1439435989,已给出解决方案且已通过验证,curl及openclash均使用最新版本
在不回滚curl 7.86.0之前版本解决方案如下: vim /usr/share/openclash/openclash.sh 39行,使用以下代码替换原有urlencode()方法代码即可:
urlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
local pos c o
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo "${encoded}" # You can either set a return variable (FASTER)
REPLY="${encoded}" #+or echo the result (EASIER)... both... :p
}
应该是更新curl后出现的问题,旧版正常,已经测试
v7.86.0
出现该问题
已在楼上给出解决方案
https://github.com/vernesong/OpenClash/issues/2799#issue-1439435989,已给出解决方案且已通过验证,curl及openclash均使用最新版本
在不回滚curl 7.86.0之前版本解决方案如下: vim /usr/share/openclash/openclash.sh 39行,使用以下代码替换原有urlencode()方法代码即可:
urlencode() { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos<strlen ; pos++ )); do c=${string:$pos:1} case "$c" in [-_.~a-zA-Z0-9] ) o="${c}" ;; * ) printf -v o '%%%02x' "'$c" esac encoded+="${o}" done echo "${encoded}" # You can either set a return variable (FASTER) REPLY="${encoded}" #+or echo the result (EASIER)... both... :p }
额,在线订阅转换也因为curl出错了。用你这个方法后,排除节点失效了
dev
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days
Verify Steps
OpenClash Version
v0.45.70-beta
Bug on Environment
Lean
Bug on Platform
Linux-amd64(x86-64)
To Reproduce
游戏规则列表
或第三方规则集列表
点击更新规则Describe the Bug
https://github.com/vernesong/OpenClash/blob/e475a5d3bc05fdf60ab1c8d24432122684451701/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh#L5-L13
curl
执行完没有任何输出 https://github.com/vernesong/OpenClash/blob/e475a5d3bc05fdf60ab1c8d24432122684451701/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh#L8DOWNLOAD_PATH
被赋予空值 https://github.com/vernesong/OpenClash/blob/e475a5d3bc05fdf60ab1c8d24432122684451701/luci-app-openclash/root/usr/share/openclash/openclash_download_rule_list.sh#L67OpenClash Log
OpenClash Config
No response
Expected Behavior
Screenshots