Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
remove temporary cookie file after test
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Sep 13, 2013
1 parent b79290f commit 636ec64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Webinject/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ For information and documentation, visit the website at http://www.webinject.org
---------------------------------
Release History:

Version 1.80 - ...
- remove temporary cookie file after test

Version 1.78 - Thu Jan 3 22:49:56 CET 2013
- replace parsedresult in xml input file
- added fallback timeout for test cases
Expand Down
11 changes: 10 additions & 1 deletion Webinject/lib/Webinject.pm
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ sub _get_useragent {
my $useragent = LWP::UserAgent->new(keep_alive=>1);

# store cookies in our LWP object
my($fh, $cookietempfilename) = tempfile(undef, UNLINK => 1);
my $fh;
our $cookietempfilename;
($fh, $cookietempfilename) = tempfile(undef, UNLINK => 1);
unlink ($cookietempfilename);
$useragent->cookie_jar(HTTP::Cookies->new(
file => $cookietempfilename,
Expand Down Expand Up @@ -1899,6 +1901,13 @@ EOB
exit 3;
}

################################################################################
# make sure we don't keep the cookie temp file
END {
our $cookietempfilename;
unlink($cookietempfilename) if $cookietempfilename;
}

=head1 EXAMPLES
=head2 example test case
Expand Down

0 comments on commit 636ec64

Please sign in to comment.