From: Vladimír Čunát Date: Fri, 16 Jun 2017 07:09:22 +0000 (+0200) Subject: modules/http: fix finding the static files X-Git-Tag: v1.3.1~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6453a67efcfa32adfc987748510b73044163ba5a;p=thirdparty%2Fknot-resolver.git modules/http: fix finding the static files I also verified there's no other usage of the `moduledir` symbol from lua. Bug introduced in 2f81b1118430 (within !298). --- diff --git a/NEWS b/NEWS index c339bd202..472c15bdf 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +Knot Resolver 1.3.1 (2017-06-xx) +================================ + +Bugfixes +-------- +- modules/http: fix finding the static files (bug from 1.3.0) + + Knot Resolver 1.3.0 (2017-06-13) ================================ diff --git a/modules/http/http.lua b/modules/http/http.lua index f064ba98b..d48a1d151 100644 --- a/modules/http/http.lua +++ b/modules/http/http.lua @@ -34,9 +34,10 @@ local mime_types = { -- Preload static contents, nothing on runtime will touch the disk local function pgload(relpath, modname) if not modname then modname = 'http' end - local fp, err = io.open(string.format('%s/%s/%s', moduledir, modname, relpath), 'r') + local mdir = moduledir() + local fp, err = io.open(string.format('%s/%s/%s', mdir, modname, relpath), 'r') if not fp then - fp, err = io.open(string.format('%s/%s/static/%s', moduledir, modname, relpath), 'r') + fp, err = io.open(string.format('%s/%s/static/%s', mdir, modname, relpath), 'r') end if not fp then error(err) end local data = fp:read('*all')