def page_not_found(e): """ 404 error page. """ add_request(REQUEST_OTHER, request.path) return render_template_string( open(helpers.get_html_path('404.html')).read())
def index(): """ Render the template for the onionshare landing page. """ add_request(REQUEST_LOAD, request.path) return render_template_string( open(helpers.get_html_path('index.html')).read(), slug=slug, file_info=file_info, filename=os.path.basename(zip_filename).decode("utf-8"), filesize=zip_filesize, filesize_human=helpers.human_readable_filesize(zip_filesize) )
def index(slug_candidate): if not helpers.constant_time_compare(slug.encode('ascii'), slug_candidate.encode('ascii')): abort(404) add_request(REQUEST_LOAD, request.path) return render_template_string( open(helpers.get_html_path('index.html')).read(), slug=slug, file_info=file_info, filename=os.path.basename(zip_filename).decode("utf-8"), filesize=zip_filesize, filesize_human=helpers.human_readable_filesize(zip_filesize), strings=strings.strings)
def index(slug_candidate): if not helpers.constant_time_compare(slug.encode('ascii'), slug_candidate.encode('ascii')): abort(404) add_request(REQUEST_LOAD, request.path) return render_template_string( open(helpers.get_html_path('index.html')).read(), slug=slug, file_info=file_info, filename=os.path.basename(zip_filename).decode("utf-8"), filesize=zip_filesize, filesize_human=helpers.human_readable_filesize(zip_filesize), strings=strings.strings )
def page_not_found(e): add_request(REQUEST_OTHER, request.path) return render_template_string(open(helpers.get_html_path('404.html')).read())