From 3f93d1f01d18ad755e85c75e5eb102b5803d5cc1 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 17 Aug 2015 00:17:02 +0300 Subject: [PATCH] Fix propagation of fancyindex_css_href configuration directive The value for fancyindex_css_href was not being propagated properly, so overriding its value did not work as expected. For example the following configuration: http { # ... fancyindex_css_href "/css/global.css"; location /subdir/ { fancyindex_css_href "/css/local.css"; } } would always use "global.css", even when accessing file listings under "/subdir". This patch fixes the issue. --- CHANGELOG.md | 3 +++ ngx_http_fancyindex_module.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1902ed5..4909e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ All notable changes to this project will be documented in this file. ### Changed - Listings in top-level directories will not generate a "Parent Directory" link as first element of the listing. (Patch by Thomas P.) +### Fixed +- Fix propagation and overriding of the `fancyindex_css_href` setting inside + nested locations. ### Added diff --git a/ngx_http_fancyindex_module.c b/ngx_http_fancyindex_module.c index 679e637..09eb688 100644 --- a/ngx_http_fancyindex_module.c +++ b/ngx_http_fancyindex_module.c @@ -1334,7 +1334,8 @@ ngx_http_fancyindex_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) ngx_conf_merge_str_value(conf->header, prev->header, ""); ngx_conf_merge_str_value(conf->footer, prev->footer, ""); - ngx_conf_merge_str_value(conf->time_format, prev->time_format, "%Y-%b-%d %H:%S"); + ngx_conf_merge_str_value(conf->css_href, prev->css_href, ""); + ngx_conf_merge_str_value(conf->time_format, prev->time_format, "%Y-%b-%d %H:%M"); ngx_conf_merge_ptr_value(conf->ignore, prev->ignore, NULL); ngx_conf_merge_value(conf->hide_symlinks, prev->hide_symlinks, 0);