Bugfix dir mode 3
This commit is contained in:
@ -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)) {
|
} else if (uri.filename == NULL || (strlen(uri.pathinfo) > 0 && (int) uri.is_static)) {
|
||||||
res.status = http_get_status(404);
|
res.status = http_get_status(404);
|
||||||
goto respond;
|
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) {
|
if (uri.is_static) {
|
||||||
|
@ -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(buf1, "%s.php", buf0);
|
||||||
sprintf(buf2, "%s.html", buf0);
|
sprintf(buf2, "%s.html", buf0);
|
||||||
|
|
||||||
if (strlen(uri->path) <= 1 || path_exists(buf0) || path_is_file(buf1) || path_is_file(buf2) ||
|
if (strlen(uri->path) <= 1 || path_exists(buf0) || path_is_file(buf1) || path_is_file(buf2)) {
|
||||||
dir_mode != URI_DIR_MODE_INFO) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user