mirror of https://git.48k.eu/ogcp
init: filter out GET /scopes/status requests
ogcp.js calls this endpoint very often, which send a request to the ogserver through the REST API. This call is needed because javascript code cannot directly talk to the ogserver since it does not know what the API_KEY is. Add a filter to skip log GET /scopes/status requests. Thanks to DaniGM for helping with this.master
parent
1a64f581ae
commit
215e3c2fc0
|
@ -17,6 +17,12 @@ app = Flask(__name__)
|
|||
app.config.from_json(ogcp_cfg_path)
|
||||
app.secret_key = urandom(16)
|
||||
|
||||
class NoScopeStatus(logging.Filter):
|
||||
def filter(self, record):
|
||||
return 'GET /scopes/status' not in record.getMessage()
|
||||
|
||||
logging.getLogger("werkzeug").addFilter(NoScopeStatus())
|
||||
|
||||
babel = Babel(app)
|
||||
csrf = CSRFProtect(app)
|
||||
bootstrap = Bootstrap(app)
|
||||
|
|
Loading…
Reference in New Issue