summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2021-10-21 18:52:48 +0000
committerEric Covener <covener@apache.org>2021-10-21 18:52:48 +0000
commit9c14928e7961060376cefbdd2274ab3c3facecd0 (patch)
tree1b88b1c283b0fdd6b027786a36eef25779bddd6b /modules/generators
parenta870a5413071cae9f49ddbd8eccda2c133fa49fd (diff)
downloadhttpd-9c14928e7961060376cefbdd2274ab3c3facecd0.tar.gz
add IndexForbiddenReturn404 to help silence scanners
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894455 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_autoindex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index 84ec593b89..f1c08b4b12 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -133,6 +133,7 @@ typedef struct autoindex_config_struct {
int desc_adjust;
int icon_width;
int icon_height;
+ int not_found;
char default_keyid;
char default_direction;
@@ -608,6 +609,11 @@ static const command_rec autoindex_cmds[] =
AP_INIT_TAKE1("IndexHeadInsert", ap_set_string_slot,
(void *)APR_OFFSETOF(autoindex_config_rec, head_insert),
DIR_CMD_PERMS, "String to insert in HTML HEAD section"),
+ AP_INIT_FLAG("IndexForbiddenReturn404", ap_set_flag_slot,
+ (void *)APR_OFFSETOF(autoindex_config_rec, not_found),
+ DIR_CMD_PERMS,
+ "Return 404 in place of 403 when Options doesn't allow indexes"),
+
{NULL}
};
@@ -2331,7 +2337,7 @@ static int handle_autoindex(request_rec *r)
"Options directive",
r->filename,
index_names ? index_names : "none");
- return HTTP_FORBIDDEN;
+ return d->not_found ? HTTP_NOT_FOUND : HTTP_FORBIDDEN;
}
}