Merge pull request #1351 from tkaehn/headerfile_vs_ipv4_address_in_header

'IPv4 address in header' shows body content
This commit is contained in:
Dirk Wetter 2019-10-26 13:14:04 +02:00 committed by GitHub
commit 53951fdb06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2175,11 +2175,12 @@ run_http_header() {
# Populate vars for HTTP time
debugme echo "$NOW_TIME: $HTTP_TIME"
# delete from pattern til the end. We ignore any leading spaces (e.g. www.amazon.de)
# Quit on first empty line to catch 98% of the cases
sed -e '/^$/q' $HEADERFILE >$HEADERFILE.tmp
# 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 >$HEADERFILE.tmp
# ^^^ Attention: filtering is for html body only as of now, doesn't work for other content yet
mv $HEADERFILE.tmp $HEADERFILE
-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