]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/http: fix finding the static files
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 16 Jun 2017 07:09:22 +0000 (09:09 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 16 Jun 2017 07:12:51 +0000 (09:12 +0200)
I also verified there's no other usage of the `moduledir` symbol from
lua.  Bug introduced in 2f81b1118430 (within !298).

NEWS
modules/http/http.lua

diff --git a/NEWS b/NEWS
index c339bd202988b6541a59aaa5bb24e3c6c0e79838..472c15bdfb0dc7252e007ff5f79b0c3aea69fec4 100644 (file)
--- 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)
 ================================
 
index f064ba98b573044d24273677933e6d2e63116316..d48a1d15161821fe24908f6f6a83f53450e72a39 100644 (file)
@@ -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')