From: Michael Tremer Date: Wed, 10 Apr 2024 15:34:28 +0000 (+0200) Subject: header.pl: Allow passing more HTTP headers to showhttpheaders() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2562ca279c1bbeae9f6ca51749e116870ee2786;p=people%2Fms%2Fipfire-2.x.git header.pl: Allow passing more HTTP headers to showhttpheaders() Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index f61c5f731..33aab6825 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -496,10 +496,24 @@ sub genmenu { } } -sub showhttpheaders -{ - print "Cache-control: private\n"; - print "Content-type: text/html; charset=UTF-8\n\n"; +sub showhttpheaders($) { + my $overwrites = shift; + + my %headers = ( + "Content-Type" => "text/html; charset=UTF-8", + "Cache-Control" => "private", + + # Overwrite anything passed + %$overwrites, + ); + + # Print all headers + foreach my $header (keys %headers) { + print "$header: $headers{$header}\n"; + } + + # End headers + print "\n"; } sub is_menu_visible($) {