logo

ap-client

CLI-based client / toolbox for ActivityPub Client-to-Server
commit: 406ddf2d43e804a1e61d2b0304ee7dff9aa610ae
parent: 5d7197e82bf2a500fda602f0fb31f494e3a3ed32
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat,  9 May 2020 09:09:26 +0200

ap-fetch.sh: check return code directly

Diffstat:

Map-fetch.sh4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ap-fetch.sh b/ap-fetch.sh @@ -14,9 +14,7 @@ then die "Usage: ${0} [curl options] <url>" fi -curl -sSL -H "${accept_header}" -I $@ | tee /dev/stderr | grep -q -i -e '^Content-Type: application/.*json' - -if [ "$?" != 0 ] +if curl -sSL -H "${accept_header}" -I $@ | tee /dev/stderr | grep -q -i -e '^Content-Type: application/.*json' then die "Doesn’t have “Content-Type: application/.*json” in the headers" fi