When read_file_lines is used to read a file, the Unix or Windows newlines will be preserved when it is written out.
---- Changes since 1.380 ----
Added a search box to the left frame of the blue theme, for finding modules, config options, help pages and text.
+All images, CSS and other static content served by Webmin has an HTTP Expires for 1 week in the future, to improve cachability.
if (-d _) {
# This is definately a directory.. list it
print DEBUG "handle_request: listing directory\n";
- &write_data("HTTP/1.0 $ok_code $ok_message\r\n");
- &write_data("Date: $datestr\r\n");
- &write_data("Server: $config{server}\r\n");
- &write_data("Content-type: text/html\r\n");
+ local $resp = "HTTP/1.0 $ok_code $ok_message\r\n".
+ "Date: $datestr\r\n".
+ "Server: $config{server}\r\n".
+ "Content-type: text/html\r\n";
+ &write_data($resp);
&write_keep_alive(0);
&write_data("\r\n");
&reset_byte_count();
print DEBUG "handle_request: outputting file\n";
open(FILE, $full) || &http_error(404, "Failed to open file");
binmode(FILE);
- &write_data("HTTP/1.0 $ok_code $ok_message\r\n");
- &write_data("Date: $datestr\r\n");
- &write_data("Server: $config{server}\r\n");
- &write_data("Content-type: ".&get_type($full)."\r\n");
- &write_data("Content-length: $stfull[7]\r\n");
- &write_data("Last-Modified: ".&http_date($stfull[9])."\r\n");
+ local $resp = "HTTP/1.0 $ok_code $ok_message\r\n".
+ "Date: $datestr\r\n".
+ "Server: $config{server}\r\n".
+ "Content-type: ".&get_type($full)."\r\n".
+ "Content-length: $stfull[7]\r\n".
+ "Last-Modified: ".&http_date($stfull[9])."\r\n".
+ "Expires: ".&http_date(time()+$config{'expires'})."\r\n";
+ &write_data($resp);
$rv = &write_keep_alive();
&write_data("\r\n");
&reset_byte_count();
"sidname", "sid",
"unauth", "^/unauthenticated/ ^[A-Za-z0-9\\-/]+\\.jar\$ ^[A-Za-z0-9\\-/]+\\.class\$ ^[A-Za-z0-9\\-/]+\\.gif\$ ^[A-Za-z0-9\\-/]+\\.conf\$ ^[A-Za-z0-9\\-/]+\\.ico\$",
"max_post", 10000,
+ "expires", 7*24*60*60,
);
foreach my $v (keys %vital) {
if (!$config{$v}) {