]> granicus.if.org Git - python/commitdiff
For this server to work on Windows, directories should use "/" as the
authorGuido van Rossum <guido@python.org>
Mon, 4 Sep 2000 15:55:31 +0000 (15:55 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 4 Sep 2000 15:55:31 +0000 (15:55 +0000)
separator in the href, not os.sep.

Added a <title> tag to directory listings.

Bumped version to 0.5.

Lib/SimpleHTTPServer.py

index 8a7775856c96f3bac853d3e5a850ce69741b135e..4cfedbc9fe9ba8b1962fee713d163f4f6039ec2a 100644 (file)
@@ -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 /