0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Merge branch 'inet_parse_address_fix' of https://github.com/spawngrid/cowboy

This commit is contained in:
Loïc Hoguin 2012-01-05 00:19:41 +01:00
commit 8ab05058e6

View file

@ -89,8 +89,8 @@ peer_addr(Req = #http_req{}) ->
end
end,
{ok, PeerAddr} = if
is_binary(RealIp) -> inet_parse:address(RealIp);
is_binary(ForwardedFor) -> inet_parse:address(ForwardedFor);
is_binary(RealIp) -> inet_parse:address(binary_to_list(RealIp));
is_binary(ForwardedFor) -> inet_parse:address(binary_to_list(ForwardedFor));
true -> {ok, PeerIp}
end,
{PeerAddr, Req3}.