From be166cac7de16215edb9bbf518e33bc6cf37dedd Mon Sep 17 00:00:00 2001 From: Yenten Date: Wed, 31 Jan 2018 15:45:13 +0200 Subject: [PATCH] fix #1041 --- sanic/request.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sanic/request.py b/sanic/request.py index ecc41d13..7da145bd 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -191,11 +191,15 @@ class Request(dict): if sock.family == socket.AF_INET: self._socket = (self.transport.get_extra_info('peername') or (None, None)) - self._ip, self._port = self._socket + # self._ip, self._port = self._socket + self._ip = self._socket[0] + self._port = self._socket[1] elif sock.family == socket.AF_INET6: self._socket = (self.transport.get_extra_info('peername') or (None, None, None, None)) - self._ip, self._port, *_ = self._socket + # self._ip, self._port, *_ = self._socket + self._ip = self._socket[0] + self._port = self._socket[1] else: self._ip, self._port = (None, None)