[core] add config option to reject pathinfo

(renamed w/ '-' instead of '_' for consistency with other feature flags)

global setting; default enabled to preserve existing behavior

If disabled, 404 Not Found is returned if request processing reaches the
step to check filesystem and path, including pathinfo, does not exist.
  server.feature-flags += ("server.http-pathinfo" => "disabled")

Note: this global feature is separate from static-file.disable-pathinfo,
which only affects requests not handled by any other module, and finally
handled by mod_staticfile.
This commit is contained in:
Glenn Strauss 2023-09-13 00:09:59 -04:00
parent d7a9c86294
commit 66349e281f
1 changed files with 1 additions and 1 deletions

View File

@ -1330,7 +1330,7 @@ static int config_insert(server *srv) {
p->defaults.mimetypes = &srv->srvconf.mimetypes_default;/*must not be NULL*/
p->defaults.h2proto = srv->srvconf.h2proto;
p->defaults.http_pathinfo =
config_feature_bool(srv, "server.http_pathinfo", 1);
config_feature_bool(srv, "server.http-pathinfo", 1);
/* initialize p->defaults from global config context */
if (p->nconfig > 0 && p->cvlist->v.u2[1]) {