t/gitweb-lib.sh: Split gitweb output into headers and body

Save HTTP headers into gitweb.headers, and the body of message into
gitweb.body in gitweb_run()

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jakub Narebski 2009-10-29 23:07:41 +01:00 committed by Junio C Hamano
parent fdb0c36e90
commit 46e09f3105

View file

@ -52,10 +52,14 @@ gitweb_run () {
rm -f gitweb.log &&
perl -- "$SCRIPT_NAME" \
>gitweb.output 2>gitweb.log &&
sed -e '/^\r$/q' <gitweb.output >gitweb.headers &&
sed -e '1,/^\r$/d' <gitweb.output >gitweb.body &&
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
# gitweb.log is left for debugging
# gitweb.output is used to parse http output
# gitweb.output is used to parse HTTP output
# gitweb.headers contains only HTTP headers
# gitweb.body contains body of message, without headers
}
. ./test-lib.sh