File tree 2 files changed +9
-10
lines changed
2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 3
3
-- Author: Marcos Kirsch
4
4
5
5
local compileAndRemoveIfNeeded = function (f )
6
- if file .open (f ) then
7
- file .close ()
6
+ if file .exists (f ) then
8
7
print (' Compiling:' , f )
9
8
node .compile (f )
10
9
file .remove (f )
Original file line number Diff line number Diff line change @@ -61,19 +61,19 @@ return function (port)
61
61
uri .args = {code = 400 , errorString = " Bad Request" , logFunction = log }
62
62
fileServeFunction = dofile (" httpserver-error.lc" )
63
63
else
64
- local fileExists = file .open (uri .file , " r" )
65
- file .close ()
64
+ local fileExists = false
66
65
67
- if not fileExists then
66
+ if not file .exists (uri .file ) then
67
+ -- print(uri.file .. " not found, checking gz version...")
68
68
-- gzip check
69
- fileExists = file .open (uri .file .. " .gz" , " r" )
70
- file .close ()
71
-
72
- if fileExists then
73
- -- print("gzip variant exists, serving that one")
69
+ if file .exists (uri .file .. " .gz" ) then
70
+ -- print("gzip variant exists, serving that one")
74
71
uri .file = uri .file .. " .gz"
75
72
uri .isGzipped = true
73
+ fileExists = true
76
74
end
75
+ else
76
+ fileExists = true
77
77
end
78
78
79
79
if not fileExists then
You can’t perform that action at this time.
0 commit comments