]> granicus.if.org Git - python/commitdiff
Fix issue11567: http.server DEFAULT_ERROR_MESSAGE format. Patch by Gennadiy Zlobin.
authorSenthil Kumaran <orsenthil@gmail.com>
Thu, 17 Mar 2011 08:43:22 +0000 (16:43 +0800)
committerSenthil Kumaran <orsenthil@gmail.com>
Thu, 17 Mar 2011 08:43:22 +0000 (16:43 +0800)
Lib/http/server.py

index 543abe0c9f949a46eb1bb5e39ff467a75455dee1..c0245ecc06d68e57245a66c61996bfe80a581078 100644 (file)
@@ -103,15 +103,20 @@ import copy
 
 # Default error message template
 DEFAULT_ERROR_MESSAGE = """\
-<head>
-<title>Error response</title>
-</head>
-<body>
-<h1>Error response</h1>
-<p>Error code %(code)d.
-<p>Message: %(message)s.
-<p>Error code explanation: %(code)s = %(explain)s.
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+        <title>Error response</title>
+    </head>
+    <body>
+        <h1>Error response</h1>
+        <p>Error code: %(code)d</p>
+        <p>Message: %(message)s.</p>
+        <p>Error code explanation: %(code)s - %(explain)s.</p>
+    </body>
+</html>
 """
 
 DEFAULT_ERROR_CONTENT_TYPE = "text/html;charset=utf-8"