BIN: analyse-headers: read from stdin if first arg is -

This makes testing much easier
master
Jonathan Hodgson 4 years ago
parent 039f4e2270
commit 27b9af6327
  1. 6
      bin/.bin/webtest/analyse-headers

@ -403,7 +403,13 @@ args+=("$@")
url="${args[0]}"
[ -z "$url" ] && die "You need to specify a url"
# If url is -, read headers from stdin
if [ "$url" = "-" ]; then
headers="$(cat -)"
else
headers="$(curl -s -I "$url")"
fi
missingHeaders="x-frame-options
content-security-policy
x-xss-protection

Loading…
Cancel
Save