@matheusbsbs / matheus-bagliano / commits / 46e09f3105
Fork 0

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>

Jakub Narebski committed Oct 29, 2009 at 23:07 UTC 46e09f310567b680c03151e048bf2b7e847611e2
1 file changed +5 -1
t/gitweb-lib.sh
+5 -1
@@ -52,10 +52,14 @@ gitweb_run () {
52 rm -f gitweb.log &&
53 perl -- "$SCRIPT_NAME" \
54 >gitweb.output 2>gitweb.log &&
55 + sed -e '/^\r$/q' <gitweb.output >gitweb.headers &&
56 + sed -e '1,/^\r$/d' <gitweb.output >gitweb.body &&
57 if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
58
59 # gitweb.log is left for debugging
58 - # gitweb.output is used to parse http output
60 + # gitweb.output is used to parse HTTP output
61 + # gitweb.headers contains only HTTP headers
62 + # gitweb.body contains body of message, without headers
63 }
64
65 . ./test-lib.sh