mirror of https://github.com/mikaku/Monitorix.git
fixed the built-in HTTP server to return a correct Content-Type header for '.css' files
This commit is contained in:
parent
e39ab6c778
commit
384bea7b88
|
@ -127,6 +127,8 @@ sub http_header {
|
||||||
|
|
||||||
if($mimetype =~ m/(html|cgi)/) {
|
if($mimetype =~ m/(html|cgi)/) {
|
||||||
print "Content-Type: text/html; charset=UTF-8\r\n";
|
print "Content-Type: text/html; charset=UTF-8\r\n";
|
||||||
|
} elsif($mimetype eq "css") {
|
||||||
|
print "Content-Type: text/css; charset=UTF-8\r\n";
|
||||||
} else {
|
} else {
|
||||||
print "Content-Type: image/$mimetype;\r\n";
|
print "Content-Type: image/$mimetype;\r\n";
|
||||||
}
|
}
|
||||||
|
@ -203,7 +205,7 @@ sub handle_request {
|
||||||
if(!$target || $target eq $base_url) {
|
if(!$target || $target eq $base_url) {
|
||||||
$target = "index.html" unless $target;
|
$target = "index.html" unless $target;
|
||||||
}
|
}
|
||||||
($mimetype) = ($target =~ m/.*\.(html|cgi|png)$/);
|
($mimetype) = ($target =~ m/.*\.(html|cgi|css|png)$/);
|
||||||
|
|
||||||
$target =~ s/^\/*//; # removes leading slashes
|
$target =~ s/^\/*//; # removes leading slashes
|
||||||
$target_cgi =~ s/^\/*//; # removes leading slashes
|
$target_cgi =~ s/^\/*//; # removes leading slashes
|
||||||
|
|
Loading…
Reference in New Issue