Fix issue 118, curl http_code sometimes is 000 but it's an invalid JSON number

This commit is contained in:
kexkey
2019-08-12 16:31:38 -04:00
committed by kexkey
parent 2d126c473b
commit 7520c97ae5

View File

@@ -63,6 +63,8 @@ curl_it() {
else
response=
fi
# When curl is unable to connect, http_code is "000" which is not a valid JSON number
[ "${rc}" -eq "0" ] && rc=0
response="{\"curl_code\":${returncode},\"http_code\":${rc},\"body\":\"${response}\"}"
echo "${response}"