Skip to content

Commit

Permalink
Add escaping to the static 404 page.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgavin committed Sep 28, 2020
1 parent eebec27 commit 8d38b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ def handle_exception!(boom)

if not_found? || bad_request?
if boom.message && boom.message != boom.class.name
body boom.message
body Rack::Utils.escape_html(boom.message)
else
content_type 'text/html'
body '<h1>' + (not_found? ? 'Not Found' : 'Bad Request') + '</h1>'
Expand Down

0 comments on commit 8d38b12

Please sign in to comment.