mirror of https://github.com/python/cpython.git
merge from 2.5 branch.
This commit is contained in:
commit
dfd1579e54
|
@ -15,6 +15,7 @@
|
||||||
import BaseHTTPServer
|
import BaseHTTPServer
|
||||||
import urllib
|
import urllib
|
||||||
import cgi
|
import cgi
|
||||||
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import mimetypes
|
import mimetypes
|
||||||
try:
|
try:
|
||||||
|
@ -131,7 +132,8 @@ def list_directory(self, path):
|
||||||
length = f.tell()
|
length = f.tell()
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header("Content-type", "text/html")
|
encoding = sys.getfilesystemencoding()
|
||||||
|
self.send_header("Content-type", "text/html; charset=%s" % encoding)
|
||||||
self.send_header("Content-Length", str(length))
|
self.send_header("Content-Length", str(length))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
return f
|
return f
|
||||||
|
|
Loading…
Reference in New Issue