Skip to content

Commit f992541

Browse files
committed
Check if static files exist in middleware first
1 parent 3395231 commit f992541

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/joy/middleware.janet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
(let [{:method method :uri uri} request
4646
filename (path/join root uri)]
4747
(if (and (some (partial = method) ["GET" "HEAD"])
48-
(path/ext filename))
48+
(path/ext filename)
49+
(file-exists? filename))
4950
{:file filename}
5051
(handler request)))))
5152

0 commit comments

Comments
 (0)