Skip to content
Snippets Groups Projects
Commit 0b3fc0f9 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge !313: modules/http: fix finding the static files

parents 619d9dac 6453a67e
Branches
Tags
1 merge request!313modules/http: fix finding the static files
Pipeline #5798 canceled with stages
in 1 hour, 18 minutes, and 5 seconds
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)
================================
......
......@@ -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')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment