Merge pull request #869 from jdutchik/339_bug_fix

339 Bug Fix for Invalid Domain Name
This commit is contained in:
Igor Chubin 2023-11-03 08:33:06 +01:00 committed by GitHub
commit 9c2de2801b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -406,12 +406,17 @@ def location_processing(location, ip_addr):
if location and location.lstrip('~ ').startswith('@'):
try:
location, region, country = _get_location(
socket.gethostbyname(
location.lstrip('~ ')[1:]))
location = '~' + location
location = _fully_qualified_location(location, region, country)
hide_full_address = not force_show_full_address
if (location.lstrip('~ ')[1:] == ""):
location, region, country = NOT_FOUND_LOCATION, None, None
else:
location, region, country = _get_location(
socket.gethostbyname(
location.lstrip('~ ')[1:]))
location = '~' + location
location = _fully_qualified_location(location, region, country)
hide_full_address = not force_show_full_address
except:
location, region, country = NOT_FOUND_LOCATION, None, None