summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_static.c
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-02-02 23:43:13 +0100
committerAlejandro Colomar <alx@kernel.org>2024-02-05 18:37:32 +0100
commitbb376c683877d2aec9ce4358536113ca5fd19d84 (patch)
treedc1298da86be962138b513b6c56cdc605a384dda /src/nxt_http_static.c
parentecd573924f5dc31e279f12249fb44e8d00e144a2 (diff)
downloadunit-bb376c683877d2aec9ce4358536113ca5fd19d84.tar.gz
unit-bb376c683877d2aec9ce4358536113ca5fd19d84.tar.bz2
Simplify, by calling nxt_conf_get_string_dup()
Refactor. Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Cc: Zhidao Hong <z.hong@f5.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src/nxt_http_static.c')
-rw-r--r--src/nxt_http_static.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c
index c4caab3c..ee25015e 100644
--- a/src/nxt_http_static.c
+++ b/src/nxt_http_static.c
@@ -117,9 +117,7 @@ nxt_http_static_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
nxt_str_set(&conf->index, "index.html");
} else {
- nxt_conf_get_string(acf->index, &str);
-
- ret = nxt_str_dup(mp, &conf->index, &str);
+ ret = nxt_conf_get_string_dup(acf->index, mp, &conf->index);
if (nxt_slow_path(ret == NULL)) {
return NXT_ERROR;
}