Bug #2685
closedadd warning for duplicate array keys in config
Description
using version 1.4.37
i would expected last item to override previous one, but result is quite unexpected, the alias does not work at all (files aren't taken from neither mapped paths).
# cat /tmp/julla.conf alias.url += ( "/jquery/" => "/usr/share/jquery/", ) alias.url += ( "/jquery/" => "/www/htdocs/cdn-js/legacy/current/dist/jquery/", )
# lighttpd -pf /tmp/julla.conf config { var.PID = 2368 var.CWD = "/etc/lighttpd/webapps.d" alias.url = ( "/jquery/" => "/usr/share/jquery/, /www/htdocs/cdn-js/legacy/current/dist/jquery/", ) server.modules = ("mod_indexfile", "mod_dirlisting", "mod_staticfile") }
Updated by stbuehler about 9 years ago
- Status changed from New to Invalid
That is the way "+" has been implemented on arrays (it doesn't know anything about the context of "alias.url"); I'm not going to change that.
Updated by gstrauss almost 9 years ago
Submitted pull request https://github.com/lighttpd/lighttpd1.4/pull/28 to issue warning and ignore duplicate keys when merging arrays (for arrays without auto-generated keys). Please reopen this issue and review the patch in the pull request.
Updated by gstrauss almost 9 years ago
Related ticket with some discussion: http://redmine.lighttpd.net/issues/2597
Updated by stbuehler almost 9 years ago
- Subject changed from weird outcome for duplicate alias map to add warning for duplicate array keys in config
- Category changed from mod_alias to core
- Status changed from Invalid to Reopened
Updated by gstrauss almost 9 years ago
FYI: it appears this issue was addressed in the 1.5.x branch back in 2005.
commit ed43eed7f29312065f786af684c5c00df2607a3c Author: Jan Kneschke <jan@kneschke.de> Date: Sat Apr 9 16:33:19 2005 +0000 duplication config-vars and duplicate array key are a error now git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@267 152afb58-edef-0310-8ab b-c4023f1b3aa9
Updated by stbuehler almost 9 years ago
r267 is not the same problem, and was also applied in 1.4.x.
I modified the patch to throw an error; I don't see any sane semantics in ignoring the entry in the second array while still showing a warning (usually you would expect the second array to overwrite entries in the first).
Updated by stbuehler almost 9 years ago
- Status changed from Reopened to Fixed
- % Done changed from 0 to 100
Applied in changeset r3103.
Updated by gstrauss over 8 years ago
- Related to Bug #1834: Invalid Content-Type sent when more than one mimetype.assign matches added
Also available in: Atom