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

This makes testing much easier
Jonathan Hodgson 3 years ago
parent cad2f2d2d5
commit e247c85bc9
  1. 8
      bin/.bin/webtest/analyse-headers

@ -403,7 +403,13 @@ args+=("$@")
url="${args[0]}"
[ -z "$url" ] && die "You need to specify a url"
headers="$(curl -s -I "$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