Ticket #1547 (reopened defect)

Opened 5 months ago

Last modified 4 months ago

conditional "add-environment"s overwrite each other / no inheritance

Reported by: soenke Assigned to: jan
Priority: normal Milestone: 1.4.20
Component: documentation Version: 1.4.18
Severity: normal Keywords: mod_setenv add-environment overwrite
Cc: Blocking:
Need Feedback: 0

Description

consider the following:

$HTTP["host"] =~ ".+\.soenke\.test$" {
        setenv.add-environment = (
                "FOO" => "BAR",
        )
}

$HTTP["host"] =~ "^web\.soenke\.test$" {
        setenv.add-environment = (
                "BAR" => "FOO",
        )
}

Now the second setenv overwrites the first. My host web.soenke.test does not inherit the FOO variable. Maybe this is wanted but than the phrase "add-" is not appropriate because it's "set" indeed (imho).

BTW. it doesn't matter if you use the "+=" operator or the "=" operator.

Attachments

Change History

02/18/2008 08:58:11 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to wontfix.

"adds a value to the process environment" - not to the configured environment.
This is by design, and i don't think it will change as it could break other setups and is not really a bug, you just like it do something other.

The '+=' operator is evaluated while parsing, not while matching conditions.
See http://trac.lighttpd.net/trac/ticket/1427#comment:6

02/26/2008 11:17:30 AM changed by soenke

  • status changed from closed to reopened.
  • resolution deleted.
  • component changed from mod_setenv to documentation.

Hi,

I guess although it's be design this should really be noted in the manual because it's unintuitive, if you look for example at Apache which does a "real add". IMHO "add-environment" is the wrong name, it's rather "set-environment"

Additionally it's going to be really scary if you have a lot of configuration done per ENV variables and you have to copy a "global" ENV into each occurence of add-enviroment. For example, in Apache I can do a global

SetEnv TESTSERVER 1

and you have it accessible everywhere. In lighty I'll have to copy it everytime where another add-environment is configured.

I'm going to add a hint into the documentation, ok?

Mmhm, maybe this could be changed in 1.5?


Add/Change #1547 (conditional "add-environment"s overwrite each other / no inheritance)




Change Properties