Hide .inc and .inc.php files

This commit is contained in:
2023-01-30 23:00:56 +01:00
parent 6f0371c46f
commit 73e0cffa78

View File

@ -134,7 +134,7 @@ static int local_handler(client_ctx_t *ctx) {
http_add_header_field(&res->hdr, "Access-Control-Allow-Origin", "*");
}
if (!strstarts(uri->req_path, "/.well-known/") && strcontains(uri->path, "/.")) {
if ((!strstarts(uri->req_path, "/.well-known/") && strcontains(uri->path, "/.")) || strends(uri->filename, ".inc") || strends(uri->filename, ".inc.php")) {
res->status = http_get_status(403);
sprintf(err_msg, "Parts of this URI are hidden.");
return 0;