From dac2ea8b45b18fc62df892a30cc07efd117916c6 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 9 Apr 2021 11:55:47 +0100 Subject: [PATCH] BIN: analyse-headers: adds -k flag like curl This flag will prevent curl from doing certificate checks The long form, `--insecure` can also be used Thanks Rob Norman for the suggestion --- bin/.bin/webtest/analyse-headers | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/.bin/webtest/analyse-headers b/bin/.bin/webtest/analyse-headers index a94853a2..8fef7912 100755 --- a/bin/.bin/webtest/analyse-headers +++ b/bin/.bin/webtest/analyse-headers @@ -432,6 +432,7 @@ usage(){ Options: -h, --help Display this help and exit + -k, --insecure Ignores certificate errors " } @@ -472,11 +473,13 @@ done set -- "${options[@]}" unset options +insecure="" # Read the options and set stuff while [[ $1 = -?* ]]; do case $1 in -h|--help) usage; exit;; + -k|--insecure) insecure="-k" ;; --) shift; break ;; *) die "invalid option: '$1'." ;; esac @@ -493,7 +496,7 @@ url="${args[0]}" if [ "$url" = "-" ]; then headers="$(cat -)" else - headers="$(curl -s -I "$url")" + headers="$(curl -s -I $insecure "$url")" fi missingHeaders="x-frame-options