Skip to content

Commit

Permalink
Make sure welcome page response is a 404 in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ellmetha committed Dec 30, 2024
1 parent b05ebd1 commit 05bff08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/marten/handlers/defaults/debug/page_not_found_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe Marten::Handlers::Defaults::Debug::PageNotFound do
handler = Marten::Handlers::Defaults::Debug::PageNotFound.new(request)

response = handler.dispatch
response.status.should eq 200
response.status.should eq 404
response.content_type.should eq "text/html"
response.content.includes?("Welcome to Marten Framework!").should be_true
end
Expand Down
2 changes: 1 addition & 1 deletion src/marten/handlers/defaults/debug/page_not_found.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Marten
rescue Routing::Errors::NoReverseMatch
end

HTTP::Response.new(ECR.render("#{__DIR__}/templates/welcome.html.ecr"))
HTTP::Response::NotFound.new(ECR.render("#{__DIR__}/templates/welcome.html.ecr"))
end
end
end
Expand Down

0 comments on commit 05bff08

Please sign in to comment.