From 807fcaca5a79c1169020b460082476842bbfda22 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 15 Dec 2013 18:12:10 +0100 Subject: [PATCH] _update: remove unused agent param --- nsupdate/api/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nsupdate/api/views.py b/nsupdate/api/views.py index 7d34a23..478d83f 100644 --- a/nsupdate/api/views.py +++ b/nsupdate/api/views.py @@ -219,7 +219,7 @@ class NicUpdateView(View): if ipaddr is None: ipaddr = request.META.get('REMOTE_ADDR') ssl = request.is_secure() - return _update(host, hostname, ipaddr, agent, ssl, logger=logger) + return _update(host, hostname, ipaddr, ssl, logger=logger) class AuthorizedNicUpdateView(View): @@ -249,22 +249,22 @@ class AuthorizedNicUpdateView(View): logger.warning('%s - is not owned by user: %s' % (hostname, request.user.username, )) return Response('nohost') logger.info("authenticated by session as user %s, creator of host %s" % (request.user.username, hostname)) + # note: we do not check the user agent here as this is interactive + # and logged-in usage - thus misbehaved user agents are no problem. ipaddr = request.GET.get('myip') if not ipaddr: # None or empty string ipaddr = request.META.get('REMOTE_ADDR') ssl = request.is_secure() - agent = request.META.get('HTTP_USER_AGENT', 'unknown') - return _update(host, hostname, ipaddr, agent, ssl, logger=logger) + return _update(host, hostname, ipaddr, ssl, logger=logger) -def _update(host, hostname, ipaddr, agent='unknown', ssl=False, logger=None): +def _update(host, hostname, ipaddr, ssl=False, logger=None): """ common code shared by the 2 update views :param host: host object :param hostname: hostname (fqdn) :param ipaddr: new ip addr (v4 or v6) - :param agent: remote's user agent string :param ssl: True if we use SSL/https :param logger: a logger object :return: Response object with dyndns2 response