mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 13:14:56 +01:00
Added double-quotes on echo commands and LN node connect string
This commit is contained in:
@@ -8,11 +8,12 @@ response_to_client()
|
||||
|
||||
local response=${1}
|
||||
local returncode=${2}
|
||||
local length=$(echo -n "${response}" | wc -c)
|
||||
|
||||
([ -z "${returncode}" ] || [ "${returncode}" -eq "0" ]) && echo -ne "HTTP/1.1 200 OK\r\n"
|
||||
[ -n "${returncode}" ] && [ "${returncode}" -ne "0" ] && echo -ne "HTTP/1.1 400 Bad Request\r\n"
|
||||
|
||||
echo -e "Content-Type: application/json\r\nContent-Length: ${#response}\r\n\r\n${response}"
|
||||
echo -e "Content-Type: application/json\r\nContent-Length: ${length}\r\n\r\n${response}"
|
||||
|
||||
# Small delay needed for the data to be processed correctly by peer
|
||||
sleep 0.2s
|
||||
|
||||
Reference in New Issue
Block a user