mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-19 15:09:30 +01:00
make filtering for header more robust
... by re-adding the former filters after ``sed '/^$q'``
This commit is contained in:
parent
7caa6a38b8
commit
0cfd30f8b8
@ -2175,9 +2175,12 @@ run_http_header() {
|
||||
# Populate vars for HTTP time
|
||||
debugme echo "$NOW_TIME: $HTTP_TIME"
|
||||
|
||||
# Quit on first empty line
|
||||
# Quit on first empty line to catch 98% of the cases
|
||||
sed -e '/^$/q' $HEADERFILE >$HEADERFILE.tmp
|
||||
mv $HEADERFILE.tmp $HEADERFILE
|
||||
# Now to be more sure delete from ~html patterns until the end. We ignore any leading spaces (e.g. www.amazon.de)
|
||||
sed -e '/<HTML>/,$d' -e '/<html>/,$d' -e '/<\!DOCTYPE/,$d' -e '/<\!doctype/,$d' \
|
||||
-e '/<XML/,$d' -e '/<xml/,$d' -e '/<\?XML/,$d' -e '/<?xml/,$d' $HEADERFILE.tmp >$HEADERFILE
|
||||
# ^^^ Attention: filtering is for ~html body only as of now
|
||||
|
||||
HTTP_STATUS_CODE=$(awk '/^HTTP\// { print $2 }' $HEADERFILE 2>>$ERRFILE)
|
||||
msg_thereafter=$(awk -F"$HTTP_STATUS_CODE" '/^HTTP\// { print $2 }' $HEADERFILE 2>>$ERRFILE) # dirty trick to use the status code as a
|
||||
|
Loading…
Reference in New Issue
Block a user