Merge pull request #3 from mzsombor/feature_source_address

fix: optional source address field
pull/323/head
mzsombor 2023-01-10 12:35:51 +02:00 committed by GitHub
commit d2c7cb3b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -378,8 +378,8 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
return port
def get_source_address(self):
value = self.get_value('source_address')
if not is_valid_ip_address(value):
value = self.get_argument('source_address', u'')
if value and not is_valid_ip_address(value):
raise InvalidValueError('Invalid source ip address: {}'.format(value))
return value