mid-way commit

This commit is contained in:
Patrick Donelan 2010-03-14 20:41:22 -04:00
parent 5f549b1305
commit 158124cf37
6 changed files with 92 additions and 79 deletions

View file

@ -434,7 +434,7 @@ The path to the WebGUI files.
=head3 configFile
The filename of the config file that WebGUI should operate from.
The filename of the config file that WebGUI should operate from, or a WebGUI::Config object
=head3 requestObject
@ -453,10 +453,10 @@ Uses simple session vars. See WebGUI::Session::Var::new() for more details.
sub open {
my $class = shift;
my $webguiRoot = shift;
my $configFile = shift;
my $c = shift;
my $request = shift;
my $config = WebGUI::Config->new($webguiRoot,$configFile);
my $self = {_config=>$config };
my $config = ref $c ? $c : WebGUI::Config->new($webguiRoot,$c);
my $self = {_config=>$config }; # TODO - if we store reference here, should we weaken WebGUI->config?
bless $self , $class;
$self->{_request} = $request if defined $request;
$self->{_response} = $request->new_response( 200 ) if defined $request;

View file

@ -278,7 +278,7 @@ sub sendHeader {
# under these circumstances, don't allow caching
if ($userId ne "1" || $cacheControl eq "none" || $self->session->setting->get("preventProxyCache")) {
$response->header("Cache-Control" => "private, max-age=1");
$request->no_cache(1);
# $request->no_cache(1); # TODO - re-enable this?
}
# in all other cases, set cache, but tell it to ask us every time so we don't mess with recently logged in users
else {
@ -304,7 +304,7 @@ sub _sendMinimalHeader {
my $response = $self->session->response;
$response->content_type('text/html; charset=UTF-8');
$response->header('Cache-Control' => 'private');
$response->no_cache(1);
# $response->no_cache(1); # TODO - re-enable this?
$response->status($self->getStatus());
# $response->status_line($self->getStatus().' '.$self->getStatusDescription()); # TODO - re-enable
return undef;

View file

@ -77,6 +77,10 @@ sub handler {
$session->errorHandler->error( $@ );
}
else {
if (defined $output) {
$session->response->body($output);
return;
}
if ($output eq "chunked") {
if ($session->errorHandler->canShowDebug()) {
$session->output->print($session->errorHandler->showDebug(),1);