Skip to content

Commit 97e87e4

Browse files
committed
plugins: wss-proxy should not return invalid JSON if sed does not exist.
We try to do a JSON response if Python is not present, but it assumes sed. We should cleanly exit on errors. Before: ``` $ PATH=/tmp ./plugins/wss-proxy/wss-proxy Something ./plugins/wss-proxy/wss-proxy: 12: sed: not found {"jsonrpc":"2.0","id":,"result":{"disable":"No python3 binary found"}} ``` After: ``` $ PATH=/tmp ./plugins/wss-proxy/wss-proxy something ./plugins/wss-proxy/wss-proxy: 12: sed: not found ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent 8a56ccd commit 97e87e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugins/wss-proxy/wss-proxy

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if ! type python3 > /dev/null 2>&1; then
66
# No python3 binary.
77
# Fortunately, CLN gives us JSON in a very standard way, so we can assume:
88
# Eg. {"jsonrpc":"2.0","id":2,"method":"getmanifest","params":{}}\n\n
9+
set -e
910
read -r JSON
1011
read -r _
1112
id=$(echo "$JSON" | sed 's/.*"id" *: *\([^,]*\),.*/\1/')

0 commit comments

Comments
 (0)