def addslash(method):
    @functools.wraps(method)
    def wrapper(self, *args, **kwargs):
        if not self.request.path.endswith("/"):
            if self.request.method in ("GET", "HEAD"):
                uri = self.request.path + "/"
                if self.request.query:
                    uri += "?" + self.request.query
                self.redirect(uri, permanent=True)
                return
            raise HTTPError(404)
        return method(self, *args, **kwargs)
    return wrapper
Add a comment to this document.
dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py/addslash--crossover with--dataset/ETHPy150Open frappe/frappe/frappe/model/document.py/Document.add_comment