Beispiel #1
0
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())
Beispiel #2
0
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)
    )
Beispiel #3
0
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)
Beispiel #4
0
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
    )
Beispiel #5
0
def page_not_found(e):
    add_request(REQUEST_OTHER, request.path)
    return render_template_string(open(helpers.get_html_path('404.html')).read())