Fixes and improvements

This commit is contained in:
imengying committed 2026-09-12 02:34:48 +08:00
1 parent 7882bbbd37
commit 39fcfe50c6
49 files changed
+5585 -4450

No files matched your search

Regular → Executable
+9 -1
View File
@@ -13,9 +13,17 @@ monitor_curl() {
esac
}
# --fail-with-body was added in curl 7.76; older builds (e.g. CentOS 7 ships
# 7.29) would abort with an unknown-option error, so fall back to --fail.
if curl --help 2>&1 | grep -q -- '--fail-with-body'; then
CURL_FAIL_FLAG=--fail-with-body
else
CURL_FAIL_FLAG=--fail
fi
request() {
response_file=$(mktemp /tmp/nodeflare-response.XXXXXX)
if monitor_curl --fail-with-body --location --silent --show-error \
if monitor_curl "$CURL_FAIL_FLAG" --location --silent --show-error \
--output "$response_file" "$@"; then
cat "$response_file"
rm -f -- "$response_file"