Bugfix dir mode 3

This commit is contained in:
2021-01-01 22:36:31 +01:00
parent 2e16fdee96
commit 8fa9f2528f
2 changed files with 4 additions and 2 deletions

View File

@ -173,6 +173,9 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int
} else if (uri.filename == NULL || (strlen(uri.pathinfo) > 0 && (int) uri.is_static)) {
res.status = http_get_status(404);
goto respond;
} else if (strlen(uri.pathinfo) != 0 && dir_mode != URI_DIR_MODE_INFO) {
res.status = http_get_status(404);
goto respond;
}
if (uri.is_static) {

View File

@ -80,8 +80,7 @@ int uri_init(http_uri *uri, const char *webroot, const char *uri_str, int dir_mo
sprintf(buf1, "%s.php", buf0);
sprintf(buf2, "%s.html", buf0);
if (strlen(uri->path) <= 1 || path_exists(buf0) || path_is_file(buf1) || path_is_file(buf2) ||
dir_mode != URI_DIR_MODE_INFO) {
if (strlen(uri->path) <= 1 || path_exists(buf0) || path_is_file(buf1) || path_is_file(buf2)) {
break;
}