I was getting an infinitely recursive redirect
Actually, this patch (to nevow.static.File) will also take care of the redirect:
274c274,281 < return self.redirect(request) ---
if not request.uri.endswith('/'): self.redirect(request) return dirlist.DirectoryLister(self.fp.path, None, self.contentTypes, self.contentEncodings, self.defaultType) #return self.redirect(request)
_________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
Lee Harr wrote:
I was getting an infinitely recursive redirect
Actually, this patch (to nevow.static.File) will also take care of the redirect:
274c274,281
< return self.redirect(request)
if not request.uri.endswith('/'): self.redirect(request)
You want to return the self.redirect(request). Otherwise the DirectoryLister will still get rendered to the body of the HTTP result, to no effect.
On Sat, 2004-04-03 at 07:54, Christopher Armstrong wrote:
Lee Harr wrote:
I was getting an infinitely recursive redirect
Actually, this patch (to nevow.static.File) will also take care of the redirect:
274c274,281
< return self.redirect(request)
if not request.uri.endswith('/'): self.redirect(request)
You want to return the self.redirect(request). Otherwise the DirectoryLister will still get rendered to the body of the HTTP result, to no effect.
It should probably also reuse the directoryListing() method, making the change:
if self.fp.isdir(): - return self.redirect(request) + if not request.uri.endswith('/'): + return self.redirect(request) + return self.directoryListing()