log user-agent in deprecated endpoint

This commit is contained in:
Son NK 2021-05-28 17:46:34 +02:00
parent 8cfd5e01dc
commit aa667851e9
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ def options():
existing: array of existing aliases
"""
LOG.e("/alias/options is obsolete")
LOG.w("/alias/options is obsolete. User-Agent:%s", request.headers["User-Agent"])
user = g.user
hostname = request.args.get("hostname")
@ -106,7 +106,7 @@ def options_v2():
"""
LOG.e("/v2/alias/options is obsolete")
LOG.w("/v2/alias/options is obsolete. User-Agent:%s", request.headers["User-Agent"])
user = g.user
hostname = request.args.get("hostname")
@ -186,7 +186,7 @@ def options_v3():
"""
LOG.e("/v3/alias/options is obsolete")
LOG.w("/v2/alias/options is obsolete. User-Agent:%s", request.headers["User-Agent"])
user = g.user
hostname = request.args.get("hostname")

View File

@ -44,7 +44,7 @@ def new_custom_alias():
409 if the alias already exists
"""
LOG.e("/alias/custom/new is obsolete")
LOG.w("/alias/custom/new is obsolete. User-Agent:%s", request.headers["User-Agent"])
user: User = g.user
if not user.can_create_new_alias():
LOG.d("user %s cannot create any custom alias", user)