mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix #785: handle binary type address given to a client socket address
This commit is contained in:
parent
573f18d0da
commit
fd5c2e99fb
@ -159,6 +159,8 @@ def create(req, sock, client, server, cfg):
|
|||||||
# http://www.ietf.org/rfc/rfc3875
|
# http://www.ietf.org/rfc/rfc3875
|
||||||
if isinstance(client, string_types):
|
if isinstance(client, string_types):
|
||||||
environ['REMOTE_ADDR'] = client
|
environ['REMOTE_ADDR'] = client
|
||||||
|
elif isinstance(client, binary_type):
|
||||||
|
environ['REMOTE_ADDR'] = str(client)
|
||||||
else:
|
else:
|
||||||
environ['REMOTE_ADDR'] = client[0]
|
environ['REMOTE_ADDR'] = client[0]
|
||||||
environ['REMOTE_PORT'] = str(client[1])
|
environ['REMOTE_PORT'] = str(client[1])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user