Merge pull request #1155 from nyuszika7h/ipv4-mapped-addr-fix

httpserver: Strip IPv4-mapped IPv6 addresses
This commit is contained in:
Valentin Lorentz 2015-08-21 22:41:33 +02:00
commit 21da27a846

View File

@ -258,6 +258,11 @@ class SupyHTTPRequestHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
self.do_X('doHead')
def address_string(self):
s = super(SupyHTTPRequestHandler, self).address_string()
# Strip IPv4-mapped IPv6 addresses such as ::ffff:127.0.0.1
return s.lstrip('::ffff:')
def log_message(self, format, *args):
log.info('HTTP request: %s - %s' %