|
109 | 109 |
|
110 | 110 | # Default error message template |
111 | 111 | DEFAULT_ERROR_MESSAGE = """\ |
112 | | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
113 | | - "http://www.w3.org/TR/html4/strict.dtd"> |
114 | | -<html> |
| 112 | +<!DOCTYPE HTML> |
| 113 | +<html lang="en"> |
115 | 114 | <head> |
116 | | - <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
| 115 | + <meta charset="utf-8"> |
117 | 116 | <title>Error response</title> |
118 | 117 | </head> |
119 | 118 | <body> |
@@ -777,14 +776,13 @@ def list_directory(self, path): |
777 | 776 | displaypath = urllib.parse.unquote(path) |
778 | 777 | displaypath = html.escape(displaypath, quote=False) |
779 | 778 | enc = sys.getfilesystemencoding() |
780 | | - title = 'Directory listing for %s' % displaypath |
781 | | - r.append('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ' |
782 | | - '"http://www.w3.org/TR/html4/strict.dtd">') |
783 | | - r.append('<html>\n<head>') |
784 | | - r.append('<meta http-equiv="Content-Type" ' |
785 | | - 'content="text/html; charset=%s">' % enc) |
786 | | - r.append('<title>%s</title>\n</head>' % title) |
787 | | - r.append('<body>\n<h1>%s</h1>' % title) |
| 779 | + title = f'Directory listing for {displaypath}' |
| 780 | + r.append('<!DOCTYPE HTML>') |
| 781 | + r.append('<html lang="en">') |
| 782 | + r.append('<head>') |
| 783 | + r.append(f'<meta charset="{enc}">') |
| 784 | + r.append(f'<title>{title}</title>\n</head>') |
| 785 | + r.append(f'<body>\n<h1>{title}</h1>') |
788 | 786 | r.append('<hr>\n<ul>') |
789 | 787 | for name in list: |
790 | 788 | fullname = os.path.join(path, name) |
|
0 commit comments