mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
parent
dd7b0525e9
commit
5a096e1b10
6 changed files with 28 additions and 28 deletions
|
|
@ -1209,14 +1209,14 @@ class FileHandler(BaseHandler):
|
|||
|
||||
# not entirely sure what the rules are here
|
||||
def open_local_file(self, req):
|
||||
import email.Utils
|
||||
import email.utils
|
||||
import mimetypes
|
||||
host = req.get_host()
|
||||
file = req.get_selector()
|
||||
localfile = url2pathname(file)
|
||||
stats = os.stat(localfile)
|
||||
size = stats.st_size
|
||||
modified = email.Utils.formatdate(stats.st_mtime, usegmt=True)
|
||||
modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
|
||||
mtype = mimetypes.guess_type(file)[0]
|
||||
headers = mimetools.Message(StringIO(
|
||||
'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue