X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCGI.pm;h=8be823a4c76ac22528692f32161a1a32ffde80db;hb=95eca0cb6162ff4cb38ab946ed550eb27159690d;hp=e1645f04c387dd0f6c9fc982d6ffa2cd9be5f767;hpb=59dabb780e7fa25290392bb3c40d3f87b404463d;p=freeside.git diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index e1645f04c..8be823a4c 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -78,21 +78,17 @@ Sets an http header. sub http_header { my ( $header, $value ) = @_; - if (exists $ENV{MOD_PERL}) { - if ( defined $HTML::Mason::Commands::r ) { #Mason - ## is this the correct pacakge for $r ??? for 1.0x and 1.1x ? - if ( $header =~ /^Content-Type$/ ) { - $HTML::Mason::Commands::r->content_type($value); - } else { - $HTML::Mason::Commands::r->header_out( $header => $value ); - } + if ( defined $HTML::Mason::Commands::r ) { #Mason + apache + if ( $header =~ /^Content-Type$/ ) { + $HTML::Mason::Commands::r->content_type($value); } else { - die "http_header called in unknown environment"; + $HTML::Mason::Commands::r->header_out( $header => $value ); } + } elsif ( defined $HTML::Mason::Commands::m ) { + $HTML::Mason::Commands::m->notes(lc("header-$header"), $value); } else { - die "http_header called not running under mod_perl"; + warn "http_header($header, $value) called with no way to set headers\n"; } - } =item menubar ITEM, URL, ...