Correctly respond with 404
This commit is contained in:
@@ -40,6 +40,7 @@ module Adamantium
|
|||||||
end
|
end
|
||||||
|
|
||||||
def not_found(_req, res, _exception)
|
def not_found(_req, res, _exception)
|
||||||
|
res.status = 404
|
||||||
res.render not_found_view
|
res.render not_found_view
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ module Adamantium
|
|||||||
def handle(req, res)
|
def handle(req, res)
|
||||||
slug = req.params[:slug]
|
slug = req.params[:slug]
|
||||||
|
|
||||||
|
res.status = File.exist?("app/content/pages/#{slug}.md") ? 200 : 404
|
||||||
res.render show, slug: slug
|
res.render show, slug: slug
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user