From 644242190e386d56dfa0d143d0d76c28ecf32d40 Mon Sep 17 00:00:00 2001 From: Frank Breedijk Date: Mon, 21 Dec 2015 15:52:22 +0100 Subject: [PATCH] More fixing --- testssl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index 28c4765..641c391 100755 --- a/testssl.sh +++ b/testssl.sh @@ -692,11 +692,11 @@ run_http_header() { out " $status_code$msg_thereafter" case $status_code in 301|302|307|308) - redirect = $(grep -a '^Location' $HEADERFILE | sed 's/Location: //' | tr -d '\r\n') + redirect=`grep -a '^Location' $HEADERFILE | sed 's/Location: //' | tr -d '\r\n'` out ", redirecting to \"$redirect\"" output_finding "status_code" "$NODEIP" "$PORT" "INFO" \ "Testing HTTP header response @ \"$URL_PATH\", $status_code$msg_thereafter, redirecting to \"$redirect\"" - if [[ -z `echo $redirect|sed -e 's/^(\/|https\:\/\/).*//'` ]]; then + if [[ ( $redirect == https* ) || ( $redirect == /* ) ]]; then output_finding "redirect" "$NODEIP" "$PORT" "INFO" "Redirect to secure url: \"$redirect\"" else pr_litered " -- Redirect to insecure url (NOT ok)"