lib/zold/node/front.rb in zold-0.26.18 vs lib/zold/node/front.rb in zold-0.26.19
- old
+ new
@@ -477,10 +477,12 @@
)
end
get '/journal/item' do
content_type('text/plain')
- IO.read(File.join(settings.journal_dir, params[:id]))
+ file = File.join(settings.journal_dir, params[:id])
+ error(404, "Journal item not found at #{file}") unless File.exist?(file)
+ IO.read(file)
end
not_found do
status(404)
content_type('text/plain')