_update: remove unused agent param
This commit is contained in:
parent
758a38f95e
commit
807fcaca5a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user