summaryrefslogtreecommitdiffstats
path: root/Lib/SimpleHTTPServer.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-17 13:34:16 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-17 13:34:16 (GMT)
commit5d076961e285a74d3d5aeae88a52517c38c44846 (patch)
treed950098a3f739e74179fb91c21274749753bb5fd /Lib/SimpleHTTPServer.py
parentbcd548bdb2f40bd739c6ff40f5903c74c190bc23 (diff)
downloadcpython-5d076961e285a74d3d5aeae88a52517c38c44846.zip
cpython-5d076961e285a74d3d5aeae88a52517c38c44846.tar.gz
cpython-5d076961e285a74d3d5aeae88a52517c38c44846.tar.bz2
Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
Diffstat (limited to 'Lib/SimpleHTTPServer.py')
-rw-r--r--Lib/SimpleHTTPServer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index ea10fb7..089936f 100644
--- a/Lib/SimpleHTTPServer.py
+++ b/Lib/SimpleHTTPServer.py
@@ -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