summaryrefslogtreecommitdiffstats
path: root/Lib/BaseHTTPServer.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-05-31 07:55:43 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-05-31 07:55:43 (GMT)
commit3c120debef6bb1705de1a89cae8f9a87d9b43ae4 (patch)
tree40f3f6ff1d965253439e6cc232c1bb0bd469f0c8 /Lib/BaseHTTPServer.py
parent40174c358fc87cd1af79969e60da5d76093768a3 (diff)
downloadcpython-3c120debef6bb1705de1a89cae8f9a87d9b43ae4.zip
cpython-3c120debef6bb1705de1a89cae8f9a87d9b43ae4.tar.gz
cpython-3c120debef6bb1705de1a89cae8f9a87d9b43ae4.tar.bz2
Patch #744041: Use only first two elements of address to support IPv6.
Diffstat (limited to 'Lib/BaseHTTPServer.py')
-rw-r--r--Lib/BaseHTTPServer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index 195d54a..7cc7b9e 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -98,7 +98,7 @@ class HTTPServer(SocketServer.TCPServer):
def server_bind(self):
"""Override server_bind to store the server name."""
SocketServer.TCPServer.server_bind(self)
- host, port = self.socket.getsockname()
+ host, port = self.socket.getsockname()[:2]
self.server_name = socket.getfqdn(host)
self.server_port = port
@@ -475,7 +475,7 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
"""
- host, port = self.client_address
+ host, port = self.client_address[:2]
return socket.getfqdn(host)
# Essentially static class variables