Merge pull request #1640 from Tronic/sockaddrfix

Fix server crash on request.server_port when bound to IPv6.
This commit is contained in:
7 2019-07-25 00:10:56 -07:00 committed by GitHub
commit 2363c0653e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,7 +388,7 @@ class Request(dict):
if forwarded_port: if forwarded_port:
return int(forwarded_port) return int(forwarded_port)
else: else:
_, port = self.transport.get_extra_info("sockname") port = self.transport.get_extra_info("sockname")[1]
return port return port
@property @property