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=82fec28abe35877513fa553747b697c158db2b95;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 5164e9731..99ec7a6bf 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -232,10 +232,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($) {