mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Add support for printing more headers
This commit is contained in:
@@ -1066,7 +1066,7 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
=head2 PrintHeader(charset, [mime-type])
|
||||
=head2 PrintHeader([charset], [mime-type], [headers])
|
||||
|
||||
Outputs the HTTP headers for an HTML page. The optional charset parameter
|
||||
can be used to set a character set. Normally this function is not called
|
||||
@@ -1075,7 +1075,7 @@ directly, but is rather called by ui_print_header or header.
|
||||
=cut
|
||||
sub PrintHeader
|
||||
{
|
||||
my ($cs, $mt) = @_;
|
||||
my ($cs, $mt, $headers) = @_;
|
||||
$mt ||= "text/html";
|
||||
if ($ENV{'SSL_HSTS'} == 1 && uc($ENV{'HTTPS'}) eq "ON") {
|
||||
print "Strict-Transport-Security: max-age=31536000;\n";
|
||||
@@ -1094,6 +1094,12 @@ if ($gconfig{'extra_headers'}) {
|
||||
print $l."\n";
|
||||
}
|
||||
}
|
||||
if ($headers) {
|
||||
foreach my $h (@{$headers}) {
|
||||
my ($name, $value) = @{$h};
|
||||
print "$name: $value\n";
|
||||
}
|
||||
}
|
||||
if (!$gconfig{'no_frame_options'}) {
|
||||
print "X-Frame-Options: SAMEORIGIN\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user