Skip to content

Commit

Permalink
Merge pull request #601 from abersheeran/master
Browse files Browse the repository at this point in the history
Fix html escape
  • Loading branch information
tomchristie committed Aug 19, 2019
2 parents 753cf6a + 6060383 commit cba5eb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion starlette/middleware/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import html
import asyncio
import inspect
import traceback
Expand Down Expand Up @@ -221,7 +222,7 @@ def generate_html(self, exc: Exception, limit: int = 7) -> str:
exc_html += self.generate_frame_html(frame, center_lineno, is_collapsed)
is_collapsed = True

error = f"{traceback_obj.exc_type.__name__}: {traceback_obj}"
error = f"{traceback_obj.exc_type.__name__}: {html.escape(str(traceback_obj))}"

return TEMPLATE.format(styles=STYLES, js=JS, error=error, exc_html=exc_html)

Expand Down

0 comments on commit cba5eb8

Please sign in to comment.