logo

utils

~/.local/bin tools and git-hooks
commit: 01d81014cbde7cd63bf28dea8e76a9b2f37df3fd
parent: 7c77a9bde2dd22736c9e77e99fcdfffb4fbcf0e6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  3 Mar 2019 03:36:07 +0100

bin/ap-fetch.sh: Fix logic, headers are case-insensitive

Diffstat:

Mbin/ap-fetch.sh4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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