diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c index 975ec0e..c8e9c6c 100644 --- a/src/mod_dirlisting.c +++ b/src/mod_dirlisting.c @@ -726,18 +726,24 @@ static void http_list_directory_header(server *srv, connection *con, plugin_data if (p->conf.auto_layout) { buffer_append_string_len(out, CONST_STR_LEN( - "\n" - "\n" + "\n" + "\n" "\n" - "Index of " )); + if (!buffer_string_is_empty(p->conf.encoding)) { + buffer_append_string_len(out, CONST_STR_LEN("<meta charset=\"")); + buffer_append_string_buffer(out, p->conf.encoding); + buffer_append_string_len(out, CONST_STR_LEN("\">\n")); + } + buffer_append_string_len(out, CONST_STR_LEN("<title>Index of ")); buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML); buffer_append_string_len(out, CONST_STR_LEN("\n")); if (!buffer_string_is_empty(p->conf.external_css)) { + buffer_append_string_len(out, CONST_STR_LEN("")); buffer_append_string_len(out, CONST_STR_LEN("conf.external_css); - buffer_append_string_len(out, CONST_STR_LEN("\" />\n")); + buffer_append_string_len(out, CONST_STR_LEN("\">\n")); } else { buffer_append_string_len(out, CONST_STR_LEN( "