Skip to content

Commit

Permalink
- fix for web sites having leading spaces b4 html/xml content starts
Browse files Browse the repository at this point in the history
  • Loading branch information
drwetter committed Dec 22, 2015
1 parent c3269f1 commit 5c19bf5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ run_http_header() {
local header
local -i ret
local referer useragent
local url
local url redirect

outln; pr_headlineln " Testing HTTP header response @ \"$URL_PATH\" "
outln
Expand Down Expand Up @@ -629,8 +629,8 @@ run_http_header() {

debugme echo "$NOW_TIME: $HTTP_TIME"

sed -e '/^<HTML/,$d' -e '/^<html/,$d' -e '/^<XML /,$d' -e '/<?XML /,$d' \
-e '/^<xml /,$d' -e '/<?xml /,$d' -e '/^<\!DOCTYPE/,$d' -e '/^<\!doctype/,$d' $HEADERFILE >$HEADERFILE.2
sed -e '/^ .<HTML/,$d' -e '/^ .<html/,$d' -e '/^ .<XML /,$d' -e '/ .<?XML /,$d' \
-e '/^ .<xml /,$d' -e '/ .<?xml /,$d' -e '/^ .<\!DOCTYPE/,$d' -e '/^ .<\!doctype/,$d' $HEADERFILE >$HEADERFILE.2
#### ^^^ Attention: the filtering for the html body only as of now, doesn't work for other content yet
mv $HEADERFILE.2 $HEADERFILE # sed'ing in place doesn't work with BSD and Linux simultaneously
ret=0
Expand Down Expand Up @@ -5478,4 +5478,4 @@ fi
exit $?


# $Id: testssl.sh,v 1.428 2015/12/22 19:31:51 dirkw Exp $
# $Id: testssl.sh,v 1.429 2015/12/22 20:08:51 dirkw Exp $

0 comments on commit 5c19bf5

Please sign in to comment.