diff Lib/IMPL/Web/Application/Response.pm @ 97:964587c5183c

Added SecureCall to Web QueryHandlers stack many bug fixes to Security and Web Application modules
author wizard
date Tue, 04 May 2010 04:04:37 +0400
parents 67eb8eaec3d4
children 4267a2ac3d46
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Response.pm	Fri Apr 30 15:03:38 2010 +0400
+++ b/Lib/IMPL/Web/Application/Response.pm	Tue May 04 04:04:37 2010 +0400
@@ -102,7 +102,7 @@
 		$opt{-expires} = $this->expires if $this->expires;
 		
 		my $refCookies = $this->cookies;
-		$opt{-cookie} = [map CGI::Cookie->new(-name => $_, $refCookies->{$_} ), keys %$refCookies] if $refCookies;
+		$opt{-cookie} = [map _createCookie($_,$refCookies->{$_}), keys %$refCookies] if $refCookies;
 		
 		my $hOut = $this->streamOut;
 		
@@ -112,6 +112,10 @@
 	}
 }
 
+sub _createCookie {
+	return UNIVERSAL::isa($_[1], 'CGI::Cookie') ? $_[1] : CGI::Cookie->new(-name => $_[0], -value => $_[1] );
+}
+
 sub setCookie {
 	my ($this,$name,$value) = @_;
 	
@@ -157,8 +161,8 @@
 	my $hOut = $this->streamOut;
 	
 	$this->_PrintHeader();
-	
-	$this->_streamBody(undef);
+
+	close $this->_streamBody();
 	
 	if ($this->buffered) {
 		print $hOut ${$this->_bufferBody};