mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
inet_address:parse/1 does not accept binaries as an input, only strings
This commit is contained in:
parent
5c101560df
commit
ade1fb93ca
1 changed files with 2 additions and 2 deletions
|
@ -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}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue