issue Issue 1474 attachment: addrinfo.patch, thanks Jonathan
This commit is contained in:
+3
-5
@@ -95,7 +95,7 @@ from settings import global_settings
|
||||
from validators import CRYPT
|
||||
from cache import CacheInRam
|
||||
from html import URL, xmlescape
|
||||
from utils import is_valid_ip_address
|
||||
from utils import is_valid_ip_address, getipaddrinfo
|
||||
from rewrite import load, url_in, THREAD_LOCAL as rwthread, \
|
||||
try_rewrite_on_error, fixup_missing_path_info
|
||||
import newcron
|
||||
@@ -471,13 +471,11 @@ def wsgibase(environ, responder):
|
||||
local_hosts.add(socket.gethostname())
|
||||
local_hosts.add(fqdn)
|
||||
local_hosts.update([
|
||||
ip[4][0] for ip in socket.getaddrinfo(
|
||||
fqdn, 0)])
|
||||
ip[4][0] for ip in getipaddrinfo(fqdn)])
|
||||
if env.server_name:
|
||||
local_hosts.add(env.server_name)
|
||||
local_hosts.update([
|
||||
ip[4][0] for ip in socket.getaddrinfo(
|
||||
env.server_name, 0)])
|
||||
ip[4][0] for ip in getipaddrinfo(env.server_name)])
|
||||
except (socket.gaierror, TypeError):
|
||||
pass
|
||||
global_settings.local_hosts = list(local_hosts)
|
||||
|
||||
Reference in New Issue
Block a user