Keep directory listing compile-time option

This commit is contained in:
Sergey Lyubka committed 2021-07-21 11:05:27 +01:00
1 parent 3808dd3222
commit 0d5d7bb26f
5 files changed
+2 -17

No files matched your search

+1 -5
View File
@@ -868,11 +868,7 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm,
#endif
if (is_index && fp == NULL) {
#if MG_ENABLE_DIRECTORY_LISTING
if (opts->enable_dirlist && strcmp(opts->enable_dirlist, "no") == 0) {
mg_http_reply(c, 403, "", "%s", "Denied");
} else {
listdir(c, hm, opts, t2);
}
listdir(c, hm, opts, t2);
#else
mg_http_reply(c, 403, "", "%s", "Directory listing not supported");
#endif