def check_safe_root(self, url):
if url is None:
return None
if self.safe_roots is None:
return url
if url.startswith(request.url_root) or url.startswith('/'):
# A URL inside the same app is deemed to always be safe
return url
for safe_root in self.safe_roots:
if url.startswith(safe_root):
return url
return None
评论列表
文章目录