Skip to content

Commit d054497

Browse files
committed
Fix misuse of sys.fpath()
1 parent 3ea4e79 commit d054497

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
-- Serves files from /static otherwise.
66

77
local async = require('async')
8+
local paths = require('paths')
89
local sys = require('sys')
910

1011
local function getMime(ext)
@@ -57,7 +58,7 @@ local function handler(req, res, client)
5758
local ext = string.match(path, "%.%l%l%l?")
5859
local mime = getMime(ext)
5960

60-
local file = io.open(sys.fpath() .. '/static' .. path, 'r')
61+
local file = io.open(paths.dirname(sys.fpath()) .. '/static' .. path, 'r')
6162
if file ~= nil then
6263
local content = file:read("*all")
6364
file:close()

0 commit comments

Comments
 (0)