diff --git a/mongoose.c b/mongoose.c index ed977a7fa5..0be9e235eb 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1474,7 +1474,7 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm, (int) hm->uri.len, hm->uri.ptr); flags = 0; } else if (flags & MG_FS_DIR) { - if (((snprintf(path + n, path_size - n, "/index.html") > 0 && + if (((snprintf(path + n, path_size - n, "/" MG_HTTP_INDEX) > 0 && (tmp = fs->stat(path, NULL, NULL)) != 0) || (snprintf(path + n, path_size - n, "/index.shtml") > 0 && (tmp = fs->stat(path, NULL, NULL)) != 0))) { diff --git a/src/http.c b/src/http.c index 2cd3877992..87bbf57071 100644 --- a/src/http.c +++ b/src/http.c @@ -725,7 +725,7 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm, (int) hm->uri.len, hm->uri.ptr); flags = 0; } else if (flags & MG_FS_DIR) { - if (((snprintf(path + n, path_size - n, "/index.html") > 0 && + if (((snprintf(path + n, path_size - n, "/" MG_HTTP_INDEX) > 0 && (tmp = fs->stat(path, NULL, NULL)) != 0) || (snprintf(path + n, path_size - n, "/index.shtml") > 0 && (tmp = fs->stat(path, NULL, NULL)) != 0))) {