[ python-Bugs-1314572 ] Trailing slash redirection for SimpleHTTPServer
SourceForge.net
noreply at sourceforge.net
Thu Oct 6 08:49:57 CEST 2005
Bugs item #1314572, was opened at 2005-10-05 23:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1314572&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Josiah Carlson (josiahcarlson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Trailing slash redirection for SimpleHTTPServer
Initial Comment:
As known by every serious web server developer, the
lack of a trailing slash on direcories can cause some
serious web page loading issues. Take the following
examples...
Let us imagine that: 'http://www.foo.com/foo' points to
a directory containing 'index.html'. A web server
could return the contents of 'index.html', but then any
relative urls would be relative to the / path of the
web server.
A better web server would instead redirect the user to
'http://www.foo.com/foo/'. SimpleHTTPServer does not
do any such redirection, and the documentation for
forcing a client to redirect is difficult to find on
the internet. In the comments I will post a
replacement
SimpleHTTPServer.SimpleHTTPRequestHandler.send_head
method which does automatic trailing slash redirection.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1314572&group_id=5470
More information about the Python-bugs-list
mailing list