[mod_extforward] fix extforward.headers defaults (fixes
(thx glen)
Regression in lighttpd 1.4.56 - 1.4.58 when extforward.headers is
not set in lighttpd.conf.
Workaround: extforward.headers = ("X-Forwarded-For")
(or appropriate value depending on header sent by upstream proxy)
x-ref:
"mod_extforward regression 1.4.56"
@@ -405,6 +405,10 @@ SETDEFAULTS_FUNC(mod_extforward_set_defaults) {
p->defaults.headers = p->default_headers = array_init(2);
array_insert_value(p->default_headers,CONST_STR_LEN("X-Forwarded-For"));
array_insert_value(p->default_headers,CONST_STR_LEN("Forwarded-For"));
+ for (uint32_t i = 0; i < p->default_headers->used; ++i) {
+ data_string * const ds = (data_string *)p->default_headers->data[i];
+ ds->ext = http_header_hkey_get(CONST_BUF_LEN(&ds->value));
+ }
}
/* attempt to warn if mod_extforward is not last module loaded to hook
