diff --git a/src/client.c b/src/client.c index 9726040..065b5bc 100644 --- a/src/client.c +++ b/src/client.c @@ -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) { diff --git a/src/uri.c b/src/uri.c index 94fbb80..6219784 100644 --- a/src/uri.c +++ b/src/uri.c @@ -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; }