lib/servel/app.rb in servel-0.7.0 vs lib/servel/app.rb in servel-0.8.0
- old
+ new
@@ -14,9 +14,11 @@
return @file_server.call(env) if fs_path.file?
return redirect("#{url_root}#{url_path}/") unless env["PATH_INFO"].end_with?("/")
+ return [404, {}, []] unless fs_path.exist?
+
index(Servel::Locals.new(url_root: url_root, url_path: url_path, fs_path: fs_path))
end
def redirect(location)
[302, { "Location" => location }, []]
\ No newline at end of file