Project

General

Profile

Actions

Bug #2685

closed

add warning for duplicate array keys in config

Added by glen almost 9 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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")

}

Related issues 1 (0 open1 closed)

Related to Bug #1834: Invalid Content-Type sent when more than one mimetype.assign matchesFixed2008-11-30Actions
Actions #1

Updated by stbuehler almost 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.

Actions #2

Updated by gstrauss over 8 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.

Actions #3

Updated by gstrauss over 8 years ago

Related ticket with some discussion: http://redmine.lighttpd.net/issues/2597

Actions #4

Updated by stbuehler over 8 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
Actions #5

Updated by stbuehler over 8 years ago

  • Target version set to 1.4.40
Actions #6

Updated by gstrauss over 8 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
Actions #7

Updated by stbuehler over 8 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).

Actions #8

Updated by stbuehler over 8 years ago

  • Status changed from Reopened to Fixed
  • % Done changed from 0 to 100

Applied in changeset r3103.

Actions #9

Updated by gstrauss over 8 years ago

  • Related to Bug #1834: Invalid Content-Type sent when more than one mimetype.assign matches added
Actions

Also available in: Atom