commit: c684d77ff8b9032df8dbd0886853b449e7360dcf
parent: 9864193d04d7f02f463566cafc38cfdcb2e89f54
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 25 May 2020 11:42:47 +0200
ap-fetch.sh: fix header-check logic
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ap-fetch.sh b/ap-fetch.sh
@@ -16,7 +16,7 @@ fi
if curl -sSL -H "${accept_header}" -I $@ | tee /dev/stderr | grep -q -i -e '^Content-Type: application/.*json'
then
+ curl -sSL -H "${accept_header}" $@
+else
die "Doesn’t have “Content-Type: application/.*json” in the headers"
fi
-
-curl -sSL -H "${accept_header}" $@