diff options
author | Guido van Rossum <guido@python.org> | 2000-09-04 15:55:31 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-09-04 15:55:31 (GMT) |
commit | 1d105d15d38578f9a2877826cc142e6c21bfdc55 (patch) | |
tree | 5163b71aac7bfe039d9bc0779b01488898f7ffe7 /Lib/SimpleHTTPServer.py | |
parent | 410a84441d73ae9567d52aa39a0ed8866a616644 (diff) | |
download | cpython-1d105d15d38578f9a2877826cc142e6c21bfdc55.zip cpython-1d105d15d38578f9a2877826cc142e6c21bfdc55.tar.gz cpython-1d105d15d38578f9a2877826cc142e6c21bfdc55.tar.bz2 |
For this server to work on Windows, directories should use "/" as the
separator in the href, not os.sep.
Added a <title> tag to directory listings.
Bumped version to 0.5.
Diffstat (limited to 'Lib/SimpleHTTPServer.py')
-rw-r--r-- | Lib/SimpleHTTPServer.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 8a77758..4cfedbc 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -6,7 +6,7 @@ and HEAD requests in a fairly straightforward manner. """ -__version__ = "0.4" +__version__ = "0.5" import os @@ -99,6 +99,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): return None list.sort(lambda a, b: cmp(a.lower(), b.lower())) f = StringIO() + f.write("<title>Directory listing for %s</title>\n" % self.path) f.write("<h2>Directory listing for %s</h2>\n" % self.path) f.write("<hr>\n<ul>\n") for name in list: @@ -107,7 +108,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): # Append / for directories or @ for symbolic links if os.path.isdir(fullname): displayname = name + "/" - linkname = name + os.sep + linkname = name + "/" if os.path.islink(fullname): displayname = name + "@" # Note: a link to a directory displays with @ and links with / |