From 5bb9eff0716710611f50071bec6167b4514edb48 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 9 Feb 2002 17:03:55 +0000 Subject: [PATCH] okay, both Apache::ASP and Mason should set no-cache headers now (closes: Bug#23) --- FS/FS/CGI.pm | 18 ++++++++++-------- htetc/global.asa | 4 ++++ htetc/handler.pl | 5 ++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 40932147e..d1c56a254 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -12,10 +12,6 @@ use FS::UID; @EXPORT_OK = qw(header menubar idiot eidiot popurl table itable ntable small_custview); -@header = ( '-Expires' => '-1', - '-Pragma' => 'no-cache', - '-Cache-Control' => 'no-cache' ); - =head1 NAME FS::CGI - Subroutines for the web interface @@ -58,6 +54,9 @@ sub header { $title + + + @@ -88,24 +87,27 @@ sub menubar { #$menubar=menubar('Main Menu', '../', 'Item', 'url', ... ); This is depriciated. Don't use it. -Sends headers and an HTML error message. +Sends an HTML error message. =cut sub idiot { #warn "idiot depriciated"; my($error)=@_; - my $cgi = &FS::UID::cgi(); +# my $cgi = &FS::UID::cgi(); # if ( $cgi->isa('CGI::Base') ) { # no strict 'subs'; # &CGI::Base::SendHeaders; # } else { - print $cgi->header( @FS::CGI::header ); +# print $cgi->header( @FS::CGI::header ); # } print < Error processing your request + + +
@@ -123,7 +125,7 @@ END This is depriciated. Don't use it. -Sends headers and an HTML error message, then exits. +Sends an HTML error message, then exits. =cut diff --git a/htetc/global.asa b/htetc/global.asa index c4b4380d6..cf6b0f679 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -47,6 +47,10 @@ use FS::svc_www; use FS::type_pkgs; sub Script_OnStart { + $Response->AddHeader('Pragma' => 'no-cache'); + $Response->AddHeader('Cache-control' => 'no-cache'); + $Response->AddHeader('Expires' => 0); + $cgi = new CGI; &cgisuidsetup($cgi); $p = popurl(2); diff --git a/htetc/handler.pl b/htetc/handler.pl index f80c79e65..5be19c443 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -109,7 +109,10 @@ sub handler $r->content_type('text/html'); #eorar - # @FS::CGI::headers or some other way to set no-cache headers!!! + my $headers = $r->headers_out; + $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache'; + #$r->no_cache(1); + $headers->{'Expires'} = '0'; my $status = $ah->handle_request($r); -- 2.11.0