+=item http_header
+
+Sets an http header.
+
+=cut
+
+sub http_header {
+ my ( $header, $value ) = @_;
+ if ( defined $HTML::Mason::Commands::r ) { #Mason + apache
+ if ( $header =~ /^Content-Type$/ ) {
+ $HTML::Mason::Commands::r->content_type($value);
+ } else {
+ $HTML::Mason::Commands::r->header_out( $header => $value );
+ }
+ } elsif ( defined $HTML::Mason::Commands::m ) {
+ $HTML::Mason::Commands::m->notes(lc("header-$header"), $value);
+ } else {
+ warn "http_header($header, $value) called with no way to set headers\n";
+ }
+}
+