chiark / gitweb /
937820f4a7c129299c2a088daf91204805700ea3
[cgi-auth-flexible.git] / tests / wrap
1 #!/bin/sh
2 set -e
3 cd "$CAFTEST_CAF"
4 exec 2>>tests/tmp/log
5 export HTTP_COOKIE=$(cat "tests/tmp/cookie")
6 export CAFTEST_URL=file:///cgi-bin/wrap
7 tests/cgi "$@" | perl -pe '
8     next if m/^$/..0;
9     next unless m/Set-Cookie: (\w+=[^; ]+)/;
10     my $cf = "tests/tmp/cookie";
11     open C, ">", "$cf.new" or die "$cf $!";
12     print C $1 or die $!;
13     close C or die $!;
14     rename "$cf.new", $cf or die "$cf $!";
15 '