Skip to content

Commit 9f9193e

Browse files
committed
Error message in http.server code. Missed to update in 3.1 branch initially.
1 parent de91276 commit 9f9193e

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

Lib/http/server.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,20 @@
103103

104104
# Default error message template
105105
DEFAULT_ERROR_MESSAGE = """\
106-
<head>
107-
<title>Error response</title>
108-
</head>
109-
<body>
110-
<h1>Error response</h1>
111-
<p>Error code %(code)d.
112-
<p>Message: %(message)s.
113-
<p>Error code explanation: %(code)s = %(explain)s.
114-
</body>
106+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
107+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
108+
<html xmlns="http://www.w3.org/1999/xhtml">
109+
<head>
110+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
111+
<title>Error response</title>
112+
</head>
113+
<body>
114+
<h1>Error response</h1>
115+
<p>Error code: %(code)d</p>
116+
<p>Message: %(message)s.</p>
117+
<p>Error code explanation: %(code)s - %(explain)s.</p>
118+
</body>
119+
</html>
115120
"""
116121

117122
DEFAULT_ERROR_CONTENT_TYPE = "text/html;charset=utf-8"

0 commit comments

Comments
 (0)