Monkeypatch flask to suppress output that isn't applicable to OnionShare

This commit is contained in:
Micah Lee 2018-09-15 22:04:08 -07:00
parent 6269f16034
commit f90e96e21a
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -32,6 +32,7 @@ import io
from distutils.version import LooseVersion as Version
from urllib.request import urlopen
import flask
from flask import (
Flask, Response, Request, request, render_template, abort, make_response,
flash, redirect, __version__ as flask_version
@ -40,6 +41,15 @@ from werkzeug.utils import secure_filename
from . import strings, common
# Stub out flask's show_server_banner function, to avoiding showing warnings that
# are not applicable to OnionShare
def stubbed_show_server_banner(env, debug, app_import_path, eager_loading):
pass
flask.cli.show_server_banner = stubbed_show_server_banner
class Web(object):
"""
The Web object is the OnionShare web server, powered by flask