+
+ node = request.node
+ subpath = request.node.subpath
+
+ # Explicitly disallow trailing slashes if we are otherwise at a node's url.
+ if request.path and request.path != "/" and request.path[-1] == "/" and subpath == "/":
+ return HttpResponseRedirect(node.get_absolute_url())
+
+ if not node.handles_subpath(subpath):
+ # If the subpath isn't handled, check settings.APPEND_SLASH. If
+ # it's True, try to correct the subpath.
+ if not settings.APPEND_SLASH: