webish: fix directory url redirection

when rendering a directory in webish, if the url did not correctly include
a trailing slash '/' then the browser will be redirected to a url which 
does.  this causes any relative links (e.g. the 'other representations'
which are links to files relative to the current directory) to be correctly
intrpreted as relative to the directory in question by the browser.

uses twisted's addSlash mechanism, which is designed for this purpose :-)
This commit is contained in:
robk-tahoe 2008-06-11 12:46:28 -07:00
parent aec1764baf
commit 021a9e370f

@ -367,6 +367,7 @@ class DirectoryAsHTML(rend.Page):
# The remainder of this class is to render the directory into
# human+browser -oriented HTML.
docFactory = getxmlfile("directory.xhtml")
addSlash = True
def __init__(self, node):
rend.Page.__init__(self)