Hidden paths -> 403

This commit is contained in:
2021-03-11 22:05:38 +01:00
parent f60cdc8228
commit 5b094ba98d

View File

@ -182,6 +182,10 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int
} else if (strlen(uri.pathinfo) != 0 && conf->local.dir_mode != URI_DIR_MODE_INFO) { } else if (strlen(uri.pathinfo) != 0 && conf->local.dir_mode != URI_DIR_MODE_INFO) {
res.status = http_get_status(404); res.status = http_get_status(404);
goto respond; goto respond;
} else if (strncmp(uri.req_path, "/.well-known/", 13) != 0 && strstr(uri.filename, "/.") != NULL) {
res.status = http_get_status(403);
sprintf(err_msg, "Parts of path are hidden.");
goto respond;
} }
if (uri.is_static) { if (uri.is_static) {