summaryrefslogtreecommitdiff
path: root/src/mod_staticfile.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-09-16 17:27:54 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2018-09-23 18:01:58 -0400
commitd61f33817cc79e00e7b0fedbd8f2692160fe24e5 (patch)
tree7fcef28a5f2884329e416903b419148a6be4108c /src/mod_staticfile.c
parent863dff6191139a24b1bfaedf4904bf81a7ca7c0b (diff)
downloadlighttpd-git-d61f33817cc79e00e7b0fedbd8f2692160fe24e5.tar.gz
[multiple] code reuse: employ array_match_*()
Diffstat (limited to 'src/mod_staticfile.c')
-rw-r--r--src/mod_staticfile.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c
index f72ee3fd..bf783a21 100644
--- a/src/mod_staticfile.c
+++ b/src/mod_staticfile.c
@@ -156,8 +156,6 @@ static int mod_staticfile_patch_connection(server *srv, connection *con, plugin_
URIHANDLER_FUNC(mod_staticfile_subrequest) {
plugin_data *p = p_d;
- size_t k;
- data_string *ds;
/* someone else has done a decision for us */
if (con->http_status != 0) return HANDLER_GO_ON;
@@ -187,17 +185,11 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) {
}
/* ignore certain extensions */
- for (k = 0; k < p->conf.exclude_ext->used; k++) {
- ds = (data_string *)p->conf.exclude_ext->data[k];
-
- if (buffer_is_empty(ds->value)) continue;
-
- if (buffer_is_equal_right_len(con->physical.path, ds->value, buffer_string_length(ds->value))) {
+ if (array_match_value_suffix(p->conf.exclude_ext, con->physical.path)) {
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- NOT handling file as static file, extension forbidden");
}
return HANDLER_GO_ON;
- }
}