libs/web: don't fail if no langauge is set in luci config
This commit is contained in:
parent
0b0c2e3c1a
commit
4c4d9b869b
1 changed files with 2 additions and 2 deletions
|
@ -149,7 +149,7 @@ function dispatch(request)
|
||||||
assert(conf.main,
|
assert(conf.main,
|
||||||
"/etc/config/luci seems to be corrupt, unable to find section 'main'")
|
"/etc/config/luci seems to be corrupt, unable to find section 'main'")
|
||||||
|
|
||||||
local lang = conf.main.lang
|
local lang = conf.main.lang or "auto"
|
||||||
if lang == "auto" then
|
if lang == "auto" then
|
||||||
local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or ""
|
local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or ""
|
||||||
for lpat in aclang:gmatch("[%w-]+") do
|
for lpat in aclang:gmatch("[%w-]+") do
|
||||||
|
|
Loading…
Reference in a new issue