diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c index 2ea0d94c..382fa09a 100644 --- a/src/mod_dirlisting.c +++ b/src/mod_dirlisting.c @@ -786,11 +786,15 @@ static void http_list_directory_header(server *srv, connection *con, plugin_data if (!buffer_string_is_empty(p->conf.show_header)) { /* if we have a HEADER file, display it in
*/ - buffer_copy_buffer(p->tmp_buf, con->physical.path); - buffer_append_slash(p->tmp_buf); - buffer_append_string_buffer(p->tmp_buf, p->conf.show_header); + buffer *hb = p->conf.show_header; + if (hb->ptr[0] != '/') { + buffer_copy_buffer(p->tmp_buf, con->physical.path); + buffer_append_slash(p->tmp_buf); + buffer_append_string_buffer(p->tmp_buf, p->conf.show_header); + hb = p->tmp_buf; + } - http_list_directory_include_file(out, p->tmp_buf, "header", p->conf.encode_header); + http_list_directory_include_file(out, hb, "header", p->conf.encode_header); } buffer_append_string_len(out, CONST_STR_LEN("