Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.

This commit is contained in:
Georg Brandl 2006-02-17 13:34:16 +00:00
parent bcd548bdb2
commit 5d076961e2
4 changed files with 21 additions and 8 deletions

View file

@ -85,7 +85,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return None
self.send_response(200)
self.send_header("Content-type", ctype)
self.send_header("Content-Length", str(os.fstat(f.fileno())[6]))
fs = os.fstat(f.fileno())
self.send_header("Content-Length", str(fs[6]))
self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
self.end_headers()
return f