mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 15:31:38 +01:00
feat: check headers for browser on /
This commit is contained in:
@@ -78,6 +78,12 @@ def reload():
|
||||
def default():
|
||||
if flask.request.method == "GET":
|
||||
|
||||
# show overview if browser #
|
||||
ua = flask.request.headers.get("User-Agent")
|
||||
content_type = flask.request.headers.get("Content-Type")
|
||||
if "Mozilla" in ua and not content_type == "application/json":
|
||||
return flask.redirect("/overview")
|
||||
|
||||
# check for arguments #
|
||||
service = flask.request.args.get("service")
|
||||
if not service:
|
||||
|
||||
Reference in New Issue
Block a user