--- src/mod_dirlisting.c +++ src/mod_dirlisting.c @@ -725,19 +725,21 @@ static void http_list_directory_header(server *srv, connection *con, plugin_data UNUSED(srv); if (p->conf.auto_layout) { - buffer_append_string_len(out, CONST_STR_LEN( - "\n" - "\n" - "\n" - "Index of " - )); + buffer_append_string_len(out, CONST_STR_LEN("<!doctype html><html><head>")); + 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("\">")); + } + 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")); + buffer_append_string_len(out, CONST_STR_LEN("")); 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( "